Java Code Examples for ims.assessment.vo.PatientAssessmentGroupVo

The following are top voted examples for showing how to use ims.assessment.vo.PatientAssessmentGroupVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPocFlag(PatientAssessmentGroupVoCollection currentAnswer, UserAssessmentInstHelper helper)
{
	// Add the records checked
	for (int i = 0; i < currentAnswer.size(); i++)
	{
		PatientAssessmentGroupVo voPatAssessGroup = currentAnswer.get(i);
		for (int j = 0; j < voPatAssessGroup.getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssessmQuestion = voPatAssessGroup.getAssessmentAnswers().get(j);
			AssessmentQuestionVo voAssessmQuestion = voPatAssessmQuestion.getAssessmentQuestion();
			//Do not modify the POC if the questions has no Answers 
			boolean isPocSelected = isPocSelected(helper, voAssessmQuestion) && hasAnswers(voPatAssessmQuestion);
			voPatAssessmQuestion.setIsPoc(new Boolean(isPocSelected));
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isVisibleNAQuestion()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatAssGroup = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				AnswerStatus answerStatus = voPatAssGroup.getAssessmentAnswers().get(j).getIsAnswered();
				if (answerStatus != null && answerStatus.equals(AnswerStatus.NOTAPPLICABLE))
					return true;
			}
		}
	}

	return false;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isVisibleNotAsnweredQuestion()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatAssGroup = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				if(isNonStandard(voPatAssGroup.getAssessmentAnswers().get(j)))
					return true;
			}
		}
	}
	return true;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for (int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y), answerGroup);
			}
		}
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean setGroupRowAnswer(PatientAssessmentGroupVo answerGroup)
{
	if (answerGroup == null)
		return false;

	DynamicGridRow groupRow = findRow(answerGroup.getAssessmentQuestionGroup());
	
	if (groupRow == null)
		return false;
	
	GroupRowData groupData = (GroupRowData) groupRow.getIdentifier();
	groupRow.setIdentifier(new GroupRowData(groupData.getConfigGroup(), answerGroup));
	

	for (int x = 0; x < answerGroup.getAssessmentAnswers().size(); x++)
	{
		setQuestionRowAnswer(groupRow, answerGroup.getAssessmentAnswers().get(x), answerGroup);
	}

	return true;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if (data == null || configGroup == null || configQuestion == null)
		return null;

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

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

	return null;
}
 
Example 7
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for(int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y));
			}
		}
	}
}
 
Example 8
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean setGroupRowAnswer(PatientAssessmentGroupVo answerGroup)
{
	if(answerGroup == null)
		return false;
	
	DynamicGridRow groupRow = findRow(answerGroup.getAssessmentQuestionGroup());	
	if(groupRow == null)
		return false;
	
	GroupRowData groupData = (GroupRowData)groupRow.getIdentifier();
	groupRow.setIdentifier(new GroupRowData(groupData.getConfigGroup(), answerGroup));
	
	
	for(int x = 0; x < answerGroup.getAssessmentAnswers().size(); x++)
	{
		setQuestionRowAnswer(groupRow, answerGroup.getAssessmentAnswers().get(x));
	}
	
	return true;
}
 
Example 9
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if(data == null || configGroup == null)
		return null;
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x) != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}
	
	return null;
}
 
Example 10
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if(data == null || configGroup == null || configQuestion == null)
		return null; 
	
	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if(instGroup == null)
		return null;
	
	for(int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if(instGroup.getAssessmentAnswers().get(x) != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}				
	}
	
	return null;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPocFlag(PatientAssessmentGroupVoCollection currentAnswer, UserAssessmentInstHelper helper)
{
	// Add the records checked
	for (int i = 0; i < currentAnswer.size(); i++)
	{
		PatientAssessmentGroupVo voPatAssessGroup = currentAnswer.get(i);
		for (int j = 0; j < voPatAssessGroup.getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssessmQuestion = voPatAssessGroup.getAssessmentAnswers().get(j);
			AssessmentQuestionVo voAssessmQuestion = voPatAssessmQuestion.getAssessmentQuestion();
			//Do not modify the POC if the questions has no Answers 
			boolean isPocSelected = isPocSelected(helper, voAssessmQuestion) && hasAnswers(voPatAssessmQuestion);
			voPatAssessmQuestion.setIsPoc(new Boolean(isPocSelected));
		}
	}
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isVisibleNAQuestion()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatAssGroup = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				AnswerStatus answerStatus = voPatAssGroup.getAssessmentAnswers().get(j).getIsAnswered();
				if (answerStatus != null && answerStatus.equals(AnswerStatus.NOTAPPLICABLE))
					return true;
			}
		}
	}

	return false;
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isVisibleNotAsnweredQuestion()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatAssGroup = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				if(isNonStandard(voPatAssGroup.getAssessmentAnswers().get(j)))
					return true;
			}
		}
	}
	return true;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for (int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y), answerGroup);
			}
		}
	}
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean setGroupRowAnswer(PatientAssessmentGroupVo answerGroup)
{
	if (answerGroup == null)
		return false;

	DynamicGridRow groupRow = findRow(answerGroup.getAssessmentQuestionGroup());
	
	if (groupRow == null)
		return false;
	
	GroupRowData groupData = (GroupRowData) groupRow.getIdentifier();
	groupRow.setIdentifier(new GroupRowData(groupData.getConfigGroup(), answerGroup));
	

	for (int x = 0; x < answerGroup.getAssessmentAnswers().size(); x++)
	{
		setQuestionRowAnswer(groupRow, answerGroup.getAssessmentAnswers().get(x), answerGroup);
	}

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

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

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

	return null;
}
 
Example 17
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for(int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y));
			}
		}
	}
}
 
Example 18
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean setGroupRowAnswer(PatientAssessmentGroupVo answerGroup)
{
	if(answerGroup == null)
		return false;
	
	DynamicGridRow groupRow = findRow(answerGroup.getAssessmentQuestionGroup());	
	if(groupRow == null)
		return false;
	
	GroupRowData groupData = (GroupRowData)groupRow.getIdentifier();
	groupRow.setIdentifier(new GroupRowData(groupData.getConfigGroup(), answerGroup));
	
	
	for(int x = 0; x < answerGroup.getAssessmentAnswers().size(); x++)
	{
		setQuestionRowAnswer(groupRow, answerGroup.getAssessmentAnswers().get(x));
	}
	
	return true;
}
 
Example 19
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if(data == null || configGroup == null)
		return null;
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x) != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}
	
	return null;
}
 
Example 20
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if(data == null || configGroup == null || configQuestion == null)
		return null; 
	
	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if(instGroup == null)
		return null;
	
	for(int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if(instGroup.getAssessmentAnswers().get(x) != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}				
	}
	
	return null;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPocFlag(PatientAssessmentGroupVoCollection currentAnswer, UserAssessmentInstHelper helper)
{
	// Add the records checked
	for (int i = 0; i < currentAnswer.size(); i++)
	{
		PatientAssessmentGroupVo voPatAssessGroup = currentAnswer.get(i);
		for (int j = 0; j < voPatAssessGroup.getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssessmQuestion = voPatAssessGroup.getAssessmentAnswers().get(j);
			AssessmentQuestionVo voAssessmQuestion = voPatAssessmQuestion.getAssessmentQuestion();
			//Do not modify the POC if the questions has no Answers 
			boolean isPocSelected = isPocSelected(helper, voAssessmQuestion) && hasAnswers(voPatAssessmQuestion);
			voPatAssessmQuestion.setIsPoc(new Boolean(isPocSelected));
		}
	}
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isVisibleNAQuestion()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatAssGroup = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				AnswerStatus answerStatus = voPatAssGroup.getAssessmentAnswers().get(j).getIsAnswered();
				if (answerStatus != null && answerStatus.equals(AnswerStatus.NOTAPPLICABLE))
					return true;
			}
		}
	}

	return false;
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isVisibleNotAsnweredQuestion()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatAssGroup = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				if(isNonStandard(voPatAssGroup.getAssessmentAnswers().get(j)))
					return true;
			}
		}
	}
	return true;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for (int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y), answerGroup);
			}
		}
	}
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean setGroupRowAnswer(PatientAssessmentGroupVo answerGroup)
{
	if (answerGroup == null)
		return false;

	DynamicGridRow groupRow = findRow(answerGroup.getAssessmentQuestionGroup());
	
	if (groupRow == null)
		return false;
	
	GroupRowData groupData = (GroupRowData) groupRow.getIdentifier();
	groupRow.setIdentifier(new GroupRowData(groupData.getConfigGroup(), answerGroup));
	

	for (int x = 0; x < answerGroup.getAssessmentAnswers().size(); x++)
	{
		setQuestionRowAnswer(groupRow, answerGroup.getAssessmentAnswers().get(x), answerGroup);
	}

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

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

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

	return null;
}
 
Example 27
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for(int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y));
			}
		}
	}
}
 
Example 28
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean setGroupRowAnswer(PatientAssessmentGroupVo answerGroup)
{
	if(answerGroup == null)
		return false;
	
	DynamicGridRow groupRow = findRow(answerGroup.getAssessmentQuestionGroup());	
	if(groupRow == null)
		return false;
	
	GroupRowData groupData = (GroupRowData)groupRow.getIdentifier();
	groupRow.setIdentifier(new GroupRowData(groupData.getConfigGroup(), answerGroup));
	
	
	for(int x = 0; x < answerGroup.getAssessmentAnswers().size(); x++)
	{
		setQuestionRowAnswer(groupRow, answerGroup.getAssessmentAnswers().get(x));
	}
	
	return true;
}
 
Example 29
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if(data == null || configGroup == null)
		return null;
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x) != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}
	
	return null;
}
 
Example 30
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if(data == null || configGroup == null || configQuestion == null)
		return null; 
	
	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if(instGroup == null)
		return null;
	
	for(int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if(instGroup.getAssessmentAnswers().get(x) != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}				
	}
	
	return null;
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPocFlag(PatientAssessmentGroupVoCollection currentAnswer, UserAssessmentInstHelper helper)
{
	// Add the records checked
	for (int i = 0; i < currentAnswer.size(); i++)
	{
		PatientAssessmentGroupVo voPatAssessGroup = currentAnswer.get(i);
		for (int j = 0; j < voPatAssessGroup.getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssessmQuestion = voPatAssessGroup.getAssessmentAnswers().get(j);
			AssessmentQuestionVo voAssessmQuestion = voPatAssessmQuestion.getAssessmentQuestion();
			//Do not modify the POC if the questions has no Answers 
			boolean isPocSelected = isPocSelected(helper, voAssessmQuestion) && hasAnswers(voPatAssessmQuestion);
			voPatAssessmQuestion.setIsPoc(new Boolean(isPocSelected));
		}
	}
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isVisibleNAQuestion()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatAssGroup = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				AnswerStatus answerStatus = voPatAssGroup.getAssessmentAnswers().get(j).getIsAnswered();
				if (answerStatus != null && answerStatus.equals(AnswerStatus.NOTAPPLICABLE))
					return true;
			}
		}
	}

	return false;
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isVisibleNotAsnweredQuestion()
{
	PatientAssessmentVo voPatientAssessment = form.getLocalContext().getPatientAssessmentVo();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatAssGroup = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				if(isNonStandard(voPatAssGroup.getAssessmentAnswers().get(j)))
					return true;
			}
		}
	}
	return true;
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for (int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y), answerGroup);
			}
		}
	}
}
 
Example 35
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean setGroupRowAnswer(PatientAssessmentGroupVo answerGroup)
{
	if (answerGroup == null)
		return false;

	DynamicGridRow groupRow = findRow(answerGroup.getAssessmentQuestionGroup());
	
	if (groupRow == null)
		return false;
	
	GroupRowData groupData = (GroupRowData) groupRow.getIdentifier();
	groupRow.setIdentifier(new GroupRowData(groupData.getConfigGroup(), answerGroup));
	

	for (int x = 0; x < answerGroup.getAssessmentAnswers().size(); x++)
	{
		setQuestionRowAnswer(groupRow, answerGroup.getAssessmentAnswers().get(x), answerGroup);
	}

	return true;
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if (data == null || configGroup == null || configQuestion == null)
		return null;

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

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

	return null;
}
 
Example 37
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for(int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y));
			}
		}
	}
}
 
Example 38
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private boolean setGroupRowAnswer(PatientAssessmentGroupVo answerGroup)
{
	if(answerGroup == null)
		return false;
	
	DynamicGridRow groupRow = findRow(answerGroup.getAssessmentQuestionGroup());	
	if(groupRow == null)
		return false;
	
	GroupRowData groupData = (GroupRowData)groupRow.getIdentifier();
	groupRow.setIdentifier(new GroupRowData(groupData.getConfigGroup(), answerGroup));
	
	
	for(int x = 0; x < answerGroup.getAssessmentAnswers().size(); x++)
	{
		setQuestionRowAnswer(groupRow, answerGroup.getAssessmentAnswers().get(x));
	}
	
	return true;
}
 
Example 39
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if(data == null || configGroup == null)
		return null;
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x) != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}
	
	return null;
}
 
Example 40
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if(data == null || configGroup == null || configQuestion == null)
		return null; 
	
	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if(instGroup == null)
		return null;
	
	for(int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if(instGroup.getAssessmentAnswers().get(x) != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}				
	}
	
	return null;
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentGroupVoCollection getAnswerGroups(PatientAssessmentGroupVoCollection currentAnswer, PatientAssessmentGroupVoCollection notAvailableAnswColl)
{
	if(currentAnswer != null && currentAnswer.size() > 0)
	{
		for (int i = 0; notAvailableAnswColl != null && i < notAvailableAnswColl.size(); i++)
		{
			//Get the first group and add those questions.....
			PatientAssessmentGroupVo voPatAssGroup = notAvailableAnswColl.get(i);
			//Add all Patient Assessment Question to existing Answers
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				PatientAssessmentQuestionVo patientAssessmentQuestionVo = voPatAssGroup.getAssessmentAnswers().get(j);
				//Clear the id of the record or we will get a Flush Dirty error - TODO Please check if it can be done differently...
				if(patientAssessmentQuestionVo.getID_PatientAssessmentQuestionIsNotNull())
					patientAssessmentQuestionVo.setID_PatientAssessmentQuestion(null);
				for (int k = 0; patientAssessmentQuestionVo.getPatientAnswersIsNotNull() && k < patientAssessmentQuestionVo.getPatientAnswers().size(); k++)
				{
					patientAssessmentQuestionVo.getPatientAnswers().get(k).setID_PatientAssessmentAnswer(null);
					if(patientAssessmentQuestionVo.getPatientAnswers().get(k).getAnswerDetailsIsNotNull())
					{
						for (int index = 0; index < patientAssessmentQuestionVo.getPatientAnswers().get(k).getAnswerDetails().size(); index++)
						{
							patientAssessmentQuestionVo.getPatientAnswers().get(k).getAnswerDetails().get(index).setID_PatientAnswerDetails(null);	
						}
					}
				}
				//End clear Id
					
				currentAnswer.get(0).getAssessmentAnswers().add(patientAssessmentQuestionVo);						
			}
		}
	}
	else
	{
		return notAvailableAnswColl;	
	}

	return currentAnswer;
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getNotApplicableQuestions()
{
	PatientAssessmentVo voPatientAssessment = filterQuestions(form.getLocalContext().getPatientAssessmentVo(), NOT_APPLICABLE);
	StringBuffer questions = new StringBuffer();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull() && voPatientAssessment.getAssessmentData().getAnswerGroupsIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo group = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < group.getAssessmentAnswers().size(); j++)
			{
				PatientAssessmentQuestionVo voPatientAssessmentQuestion = group.getAssessmentAnswers().get(j);
				if (voPatientAssessmentQuestion != null && voPatientAssessmentQuestion.getAssessmentQuestionIsNotNull() && voPatientAssessmentQuestion.getAssessmentQuestion().getQuestionIsNotNull())
				{
					questions.append(voPatientAssessmentQuestion.getAssessmentQuestion().getQuestion().getText());
					questions.append("\n");
				}
			}
		}
	}

	if(questions.length() > 0)
	{
		questions.insert(0, "The following questions are marked as Non Applicable:\n");
		questions.append("Please confirm. \n");
		return questions.toString();
	}
	
	return null;
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentDataVo copyAssessmentDataFromPreviousAssessment(PatientAssessmentVo voLastPatientAssessment)
{
	if (voLastPatientAssessment == null || voLastPatientAssessment.getAssessmentData() == null)
		return null;
	PatientAssessmentDataVo voPatientAssessmentData = (PatientAssessmentDataVo) voLastPatientAssessment.getAssessmentData().clone();
	//Clear the ids
	if(voPatientAssessmentData != null)
	{
		voPatientAssessmentData.setID_PatientAssessmentData(null);
		for (int i = 0; voPatientAssessmentData.getAnswerGroupsIsNotNull() && i < voPatientAssessmentData.getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatientAssessmentGroup = voPatientAssessmentData.getAnswerGroups().get(i);
			voPatientAssessmentGroup.setID_PatientAssessmentGroup(null);
			for (int j = 0; voPatientAssessmentGroup.getAssessmentAnswers() != null && j < voPatientAssessmentGroup.getAssessmentAnswers().size(); j++)
			{
				PatientAssessmentQuestionVo voPatientAssessmentQuestion = voPatientAssessmentGroup.getAssessmentAnswers().get(j);
				voPatientAssessmentQuestion.setID_PatientAssessmentQuestion(null);
				voPatientAssessmentQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());
				voPatientAssessmentQuestion.setIsPoc(null);
				voPatientAssessmentQuestion.setIsConfirmed(null);
				voPatientAssessmentQuestion.setIsRoleReadOnly(null);
			}
		}
	}

	return voPatientAssessmentData;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private ArrayList<String> validateAnswer(PatientAssessmentGroupVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();
	if (answer == null || answer.getAssessmentAnswers() == null)
		return errors;

	for (int x = 0; x < answer.getAssessmentAnswers().size(); x++)
	{
		errors = validateAnswer(answer.getAssessmentAnswers().get(x), errors);
	}

	return errors;
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAnswersHierarchical(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null)
		{
			setGroupRowAnswer(answerGroup);
		}
	}
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean setQuestionRowAnswer(PatientGraphicAssessmentQuestionAnswerVo graphicAnswer, PatientAssessmentGroupVo group)
{
	if (graphicAnswer == null || graphicAnswer.getPatientAnswers() == null)
		return false;

	DynamicGridRow initialQuestionRow = null;
	DynamicGridRow questionRow = getRowsByIdentifier(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 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if (data == null || configGroup == null)
		return null;

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if (data.getAnswerGroups().get(x) != null && data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null && data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}

	return null;
}
 
Example 48
Project: AvoinApotti   File: DynamicAssessmentHelper.java   Source Code and License 5 votes vote down vote up
private static void populateHCPDataForAnswerGroups(PatientAssessmentVo initialData, PatientAssessmentVo updatedData, AuthoringInformationVo author) 
{
	int answerGroups = updatedData.getAssessmentData().getAnswerGroups().size();
	
	for(int x = 0; x < answerGroups; x++)
	{
		PatientAssessmentGroupVo answerGroup = updatedData.getAssessmentData().getAnswerGroups().get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswers() != null)
		{
			int assessmentAnswers = answerGroup.getAssessmentAnswers().size();
			
			for(int y = 0; y < assessmentAnswers; y++)
			{
				PatientAssessmentQuestionVo answer = answerGroup.getAssessmentAnswers().get(y);
				
				if(answer != null && answer.getPatientAnswers() != null && answer.getIsAnswered() != null && answer.getIsAnswered().equals(AnswerStatus.ANSWERED))
				{
					int patientAnswers = answer.getPatientAnswers().size();
					
					for(int z = 0; z < patientAnswers; z++)
					{
						PatientAssessmentAnswerVo patientAnswer = answer.getPatientAnswers().get(z);
						
						if(patientAnswer != null)
						{
							populateHCPDataForPatientAnswer(initialData, patientAnswer, author);
						}
					}
				}
			}
		}
	}
}
 
Example 49
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateAnswer(PatientAssessmentGroupVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();		
	if(answer == null || answer.getAssessmentAnswers() == null)
		return errors;
	
	for(int x = 0; x < answer.getAssessmentAnswers().size(); x++)
	{
		errors = validateAnswer(answer.getAssessmentAnswers().get(x), errors);
	}
	
	return errors;
}
 
Example 50
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setAnswersHierarchical(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null)
		{
			setGroupRowAnswer(answerGroup);
		}
	}
}
 
Example 51
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentGroupVoCollection getAnswerGroups(PatientAssessmentGroupVoCollection currentAnswer, PatientAssessmentGroupVoCollection notAvailableAnswColl)
{
	if(currentAnswer != null && currentAnswer.size() > 0)
	{
		for (int i = 0; notAvailableAnswColl != null && i < notAvailableAnswColl.size(); i++)
		{
			//Get the first group and add those questions.....
			PatientAssessmentGroupVo voPatAssGroup = notAvailableAnswColl.get(i);
			//Add all Patient Assessment Question to existing Answers
			for (int j = 0; j < voPatAssGroup.getAssessmentAnswers().size(); j++)
			{
				PatientAssessmentQuestionVo patientAssessmentQuestionVo = voPatAssGroup.getAssessmentAnswers().get(j);
				//Clear the id of the record or we will get a Flush Dirty error - TODO Please check if it can be done differently...
				if(patientAssessmentQuestionVo.getID_PatientAssessmentQuestionIsNotNull())
					patientAssessmentQuestionVo.setID_PatientAssessmentQuestion(null);
				for (int k = 0; patientAssessmentQuestionVo.getPatientAnswersIsNotNull() && k < patientAssessmentQuestionVo.getPatientAnswers().size(); k++)
				{
					patientAssessmentQuestionVo.getPatientAnswers().get(k).setID_PatientAssessmentAnswer(null);
					if(patientAssessmentQuestionVo.getPatientAnswers().get(k).getAnswerDetailsIsNotNull())
					{
						for (int index = 0; index < patientAssessmentQuestionVo.getPatientAnswers().get(k).getAnswerDetails().size(); index++)
						{
							patientAssessmentQuestionVo.getPatientAnswers().get(k).getAnswerDetails().get(index).setID_PatientAnswerDetails(null);	
						}
					}
				}
				//End clear Id
					
				currentAnswer.get(0).getAssessmentAnswers().add(patientAssessmentQuestionVo);						
			}
		}
	}
	else
	{
		return notAvailableAnswColl;	
	}

	return currentAnswer;
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getNotApplicableQuestions()
{
	PatientAssessmentVo voPatientAssessment = filterQuestions(form.getLocalContext().getPatientAssessmentVo(), NOT_APPLICABLE);
	StringBuffer questions = new StringBuffer();
	if (voPatientAssessment != null && voPatientAssessment.getAssessmentDataIsNotNull() && voPatientAssessment.getAssessmentData().getAnswerGroupsIsNotNull())
	{
		for (int i = 0; i < voPatientAssessment.getAssessmentData().getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo group = voPatientAssessment.getAssessmentData().getAnswerGroups().get(i);
			for (int j = 0; j < group.getAssessmentAnswers().size(); j++)
			{
				PatientAssessmentQuestionVo voPatientAssessmentQuestion = group.getAssessmentAnswers().get(j);
				if (voPatientAssessmentQuestion != null && voPatientAssessmentQuestion.getAssessmentQuestionIsNotNull() && voPatientAssessmentQuestion.getAssessmentQuestion().getQuestionIsNotNull())
				{
					questions.append(voPatientAssessmentQuestion.getAssessmentQuestion().getQuestion().getText());
					questions.append("\n");
				}
			}
		}
	}

	if(questions.length() > 0)
	{
		questions.insert(0, "The following questions are marked as Non Applicable:\n");
		questions.append("Please confirm. \n");
		return questions.toString();
	}
	
	return null;
}
 
Example 53
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentDataVo copyAssessmentDataFromPreviousAssessment(PatientAssessmentVo voLastPatientAssessment)
{
	if (voLastPatientAssessment == null || voLastPatientAssessment.getAssessmentData() == null)
		return null;
	PatientAssessmentDataVo voPatientAssessmentData = (PatientAssessmentDataVo) voLastPatientAssessment.getAssessmentData().clone();
	//Clear the ids
	if(voPatientAssessmentData != null)
	{
		voPatientAssessmentData.setID_PatientAssessmentData(null);
		for (int i = 0; voPatientAssessmentData.getAnswerGroupsIsNotNull() && i < voPatientAssessmentData.getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatientAssessmentGroup = voPatientAssessmentData.getAnswerGroups().get(i);
			voPatientAssessmentGroup.setID_PatientAssessmentGroup(null);
			for (int j = 0; voPatientAssessmentGroup.getAssessmentAnswers() != null && j < voPatientAssessmentGroup.getAssessmentAnswers().size(); j++)
			{
				PatientAssessmentQuestionVo voPatientAssessmentQuestion = voPatientAssessmentGroup.getAssessmentAnswers().get(j);
				voPatientAssessmentQuestion.setID_PatientAssessmentQuestion(null);
				voPatientAssessmentQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());
				voPatientAssessmentQuestion.setIsPoc(null);
				voPatientAssessmentQuestion.setIsConfirmed(null);
				voPatientAssessmentQuestion.setIsRoleReadOnly(null);
			}
		}
	}

	return voPatientAssessmentData;
}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private ArrayList<String> validateAnswer(PatientAssessmentGroupVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();
	if (answer == null || answer.getAssessmentAnswers() == null)
		return errors;

	for (int x = 0; x < answer.getAssessmentAnswers().size(); x++)
	{
		errors = validateAnswer(answer.getAssessmentAnswers().get(x), errors);
	}

	return errors;
}
 
Example 55
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAnswersHierarchical(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null)
		{
			setGroupRowAnswer(answerGroup);
		}
	}
}
 
Example 56
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean setQuestionRowAnswer(PatientGraphicAssessmentQuestionAnswerVo graphicAnswer, PatientAssessmentGroupVo group)
{
	if (graphicAnswer == null || graphicAnswer.getPatientAnswers() == null)
		return false;

	DynamicGridRow initialQuestionRow = null;
	DynamicGridRow questionRow = getRowsByIdentifier(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 57
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if (data == null || configGroup == null)
		return null;

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if (data.getAnswerGroups().get(x) != null && data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null && data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}

	return null;
}
 
Example 58
Project: openMAXIMS   File: DynamicAssessmentHelper.java   Source Code and License 5 votes vote down vote up
private static void populateHCPDataForAnswerGroups(PatientAssessmentVo initialData, PatientAssessmentVo updatedData, AuthoringInformationVo author) 
{
	int answerGroups = updatedData.getAssessmentData().getAnswerGroups().size();
	
	for(int x = 0; x < answerGroups; x++)
	{
		PatientAssessmentGroupVo answerGroup = updatedData.getAssessmentData().getAnswerGroups().get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswers() != null)
		{
			int assessmentAnswers = answerGroup.getAssessmentAnswers().size();
			
			for(int y = 0; y < assessmentAnswers; y++)
			{
				PatientAssessmentQuestionVo answer = answerGroup.getAssessmentAnswers().get(y);
				
				if(answer != null && answer.getPatientAnswers() != null && answer.getIsAnswered() != null && answer.getIsAnswered().equals(AnswerStatus.ANSWERED))
				{
					int patientAnswers = answer.getPatientAnswers().size();
					
					for(int z = 0; z < patientAnswers; z++)
					{
						PatientAssessmentAnswerVo patientAnswer = answer.getPatientAnswers().get(z);
						
						if(patientAnswer != null)
						{
							populateHCPDataForPatientAnswer(initialData, patientAnswer, author);
						}
					}
				}
			}
		}
	}
}
 
Example 59
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateAnswer(PatientAssessmentGroupVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();		
	if(answer == null || answer.getAssessmentAnswers() == null)
		return errors;
	
	for(int x = 0; x < answer.getAssessmentAnswers().size(); x++)
	{
		errors = validateAnswer(answer.getAssessmentAnswers().get(x), errors);
	}
	
	return errors;
}
 
Example 60
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setAnswersHierarchical(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null)
		{
			setGroupRowAnswer(answerGroup);
		}
	}
}