Java Code Examples for ims.assessment.vo.lookups.AnswerStatus

The following are top voted examples for showing how to use ims.assessment.vo.lookups.AnswerStatus. 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 PatientAssessmentGroupVoCollection setAsNotAnswerdNonStandardQuestions(UserAssessmentVo voUserAssessment, PatientAssessmentGroupVoCollection voPatAssGroupVoColl)
{
	if(voUserAssessment == null || voPatAssGroupVoColl == null)
		return voPatAssGroupVoColl;
	
	for (int i = 0; voPatAssGroupVoColl != null && i < voPatAssGroupVoColl.size(); i++)
	{
		for (int j = 0; j < voPatAssGroupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			AssessmentQuestionVo voAssQuestion = voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).getAssessmentQuestion();
			if(voAssQuestion.getIsNonStandardIsNotNull() && voAssQuestion.getIsNonStandard().booleanValue())
			{
				voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).setIsAnswered(AnswerStatus.NOTANSWERED);
			}
			
		}
	}
	
	return voPatAssGroupVoColl;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 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   View source code 6 votes vote down vote up
private void populateUserAssessment(PatientAssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	populateGridHeaderAndFooter(data.getUserAssessment());

	if (isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if (isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);

		if (isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVoCollection filterUnanswered(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return null;

	for (int i = 0; i < answers.size(); i++)
	{
		for (int j = 0; j < answers.get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo q = answers.get(i).getAssessmentAnswers().get(j);

			q.setIsAnswered(isAnswered(q) ? AnswerStatus.ANSWERED : AnswerStatus.NOTANSWERED);
		}
	}
	return answers;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
public PatientAssessmentVo updateNotApplicableQuestionStatus(PatientAssessmentVo voPatientAssessment)
{
	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);

		AssessmentQuestionVo question = (AssessmentQuestionVo) row.getIdentifier();
		PatientAssessmentQuestionVo answer = findAnswer(voPatientAssessment.getAssessmentData().getAnswerGroups(), question);
		if (answer == null)
			throw new CodingRuntimeException("Unable to find an answer for '" + question.getQuestion().getText() + "' question.");
		// Change the status from Non Applicable to Answered
		if (isAnswerStatus(answer, AnswerStatus.NOTAPPLICABLE))
		{
			DynamicGridColumn columnNASelect = this.grid.getColumns().getByIdentifier(SELECT_NA_COLUMN);
			if (columnNASelect != null)
			{
				DynamicGridCell cellNASelect = row.getCells().get(columnNASelect);
				if (cellNASelect.getValue() instanceof Boolean && ((Boolean) cellNASelect.getValue()).booleanValue())
					answer.setIsAnswered(AnswerStatus.ANSWERED);
			}
		}
	}

	return voPatientAssessment;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateUserAssessment(Patient_AssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	populateGridHeaderAndFooter(data.getUserAssessment());

	if (isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if (isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);

		if (isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private Patient_AssessmentGroupVoCollection filterUnanswered(Patient_AssessmentGroupVoCollection answers)
{
	if (answers == null)
		return null;

	for (int i = 0; i < answers.size(); i++)
	{
		for (int j = 0; j < answers.get(i).getAssessmentAnswers().size(); j++)
		{
			Patient_AssessmentQuestionVo q = answers.get(i).getAssessmentAnswers().get(j);

			q.setIsAnswered(isAnswered(q) ? AnswerStatus.ANSWERED : AnswerStatus.NOTANSWERED);
		}
	}
	return answers;
}
 
Example 8
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void populateUserAssessment(PatientAssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);		
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();				
	
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	
	if(isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if(isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);		
		
		if(isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 9
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void populateUserAssessment(Patient_AssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);		
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();				
	
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	
	if(isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if(isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);		
		
		if(isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 10
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVoCollection setAsNotAnswerdNonStandardQuestions(UserAssessmentVo voUserAssessment, PatientAssessmentGroupVoCollection voPatAssGroupVoColl)
{
	if(voUserAssessment == null || voPatAssGroupVoColl == null)
		return voPatAssGroupVoColl;
	
	for (int i = 0; voPatAssGroupVoColl != null && i < voPatAssGroupVoColl.size(); i++)
	{
		for (int j = 0; j < voPatAssGroupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			AssessmentQuestionVo voAssQuestion = voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).getAssessmentQuestion();
			if(voAssQuestion.getIsNonStandardIsNotNull() && voAssQuestion.getIsNonStandard().booleanValue())
			{
				voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).setIsAnswered(AnswerStatus.NOTANSWERED);
			}
			
		}
	}
	
	return voPatAssGroupVoColl;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 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 12
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateUserAssessment(PatientAssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	populateGridHeaderAndFooter(data.getUserAssessment());

	if (isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if (isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);

		if (isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 13
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVoCollection filterUnanswered(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return null;

	for (int i = 0; i < answers.size(); i++)
	{
		for (int j = 0; j < answers.get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo q = answers.get(i).getAssessmentAnswers().get(j);

			q.setIsAnswered(isAnswered(q) ? AnswerStatus.ANSWERED : AnswerStatus.NOTANSWERED);
		}
	}
	return answers;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public PatientAssessmentVo updateNotApplicableQuestionStatus(PatientAssessmentVo voPatientAssessment)
{
	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);

		AssessmentQuestionVo question = (AssessmentQuestionVo) row.getIdentifier();
		PatientAssessmentQuestionVo answer = findAnswer(voPatientAssessment.getAssessmentData().getAnswerGroups(), question);
		if (answer == null)
			throw new CodingRuntimeException("Unable to find an answer for '" + question.getQuestion().getText() + "' question.");
		// Change the status from Non Applicable to Answered
		if (isAnswerStatus(answer, AnswerStatus.NOTAPPLICABLE))
		{
			DynamicGridColumn columnNASelect = this.grid.getColumns().getByIdentifier(SELECT_NA_COLUMN);
			if (columnNASelect != null)
			{
				DynamicGridCell cellNASelect = row.getCells().get(columnNASelect);
				if (cellNASelect.getValue() instanceof Boolean && ((Boolean) cellNASelect.getValue()).booleanValue())
					answer.setIsAnswered(AnswerStatus.ANSWERED);
			}
		}
	}

	return voPatientAssessment;
}
 
Example 15
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateUserAssessment(Patient_AssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	populateGridHeaderAndFooter(data.getUserAssessment());

	if (isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if (isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);

		if (isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 16
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private Patient_AssessmentGroupVoCollection filterUnanswered(Patient_AssessmentGroupVoCollection answers)
{
	if (answers == null)
		return null;

	for (int i = 0; i < answers.size(); i++)
	{
		for (int j = 0; j < answers.get(i).getAssessmentAnswers().size(); j++)
		{
			Patient_AssessmentQuestionVo q = answers.get(i).getAssessmentAnswers().get(j);

			q.setIsAnswered(isAnswered(q) ? AnswerStatus.ANSWERED : AnswerStatus.NOTANSWERED);
		}
	}
	return answers;
}
 
Example 17
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void populateUserAssessment(PatientAssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);		
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();				
	
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	
	if(isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if(isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);		
		
		if(isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 18
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void populateUserAssessment(Patient_AssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);		
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();				
	
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	
	if(isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if(isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);		
		
		if(isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 19
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo getQuestionAnswer(DynamicGridRow row)
{
	if (row == null)
		return null;

	if (row.getIdentifier() instanceof AssessmentQuestionVo)
	{
		PatientAssessmentQuestionVo vo = new PatientAssessmentQuestionVo();
		vo.setAssessmentQuestion((AssessmentQuestionVo) row.getIdentifier());
		vo.setIsMandatory(((AssessmentQuestionVo) row.getIdentifier()).getIsMandatory());
		vo.setPatientAnswers(getPatientAnswers(row));

		vo.setAllowsMultipleAnswers(Boolean.TRUE.equals(((AssessmentQuestionVo) row.getIdentifier()).getAllowsMultipleAnswers()) ? Boolean.TRUE : Boolean.FALSE);
		vo.setSequence(((AssessmentQuestionVo) row.getIdentifier()).getSequence());
		vo.setIsAnswered(AnswerStatus.NOTAPPLICABLE);

		return vo;
	}

	return null;
}
 
Example 20
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVoCollection setAsNotAnswerdNonStandardQuestions(UserAssessmentVo voUserAssessment, PatientAssessmentGroupVoCollection voPatAssGroupVoColl)
{
	if(voUserAssessment == null || voPatAssGroupVoColl == null)
		return voPatAssGroupVoColl;
	
	for (int i = 0; voPatAssGroupVoColl != null && i < voPatAssGroupVoColl.size(); i++)
	{
		for (int j = 0; j < voPatAssGroupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			AssessmentQuestionVo voAssQuestion = voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).getAssessmentQuestion();
			if(voAssQuestion.getIsNonStandardIsNotNull() && voAssQuestion.getIsNonStandard().booleanValue())
			{
				voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).setIsAnswered(AnswerStatus.NOTANSWERED);
			}
			
		}
	}
	
	return voPatAssGroupVoColl;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 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 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateUserAssessment(PatientAssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	populateGridHeaderAndFooter(data.getUserAssessment());

	if (isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if (isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);

		if (isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVoCollection filterUnanswered(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return null;

	for (int i = 0; i < answers.size(); i++)
	{
		for (int j = 0; j < answers.get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo q = answers.get(i).getAssessmentAnswers().get(j);

			q.setIsAnswered(isAnswered(q) ? AnswerStatus.ANSWERED : AnswerStatus.NOTANSWERED);
		}
	}
	return answers;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public PatientAssessmentVo updateNotApplicableQuestionStatus(PatientAssessmentVo voPatientAssessment)
{
	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);

		AssessmentQuestionVo question = (AssessmentQuestionVo) row.getIdentifier();
		PatientAssessmentQuestionVo answer = findAnswer(voPatientAssessment.getAssessmentData().getAnswerGroups(), question);
		if (answer == null)
			throw new CodingRuntimeException("Unable to find an answer for '" + question.getQuestion().getText() + "' question.");
		// Change the status from Non Applicable to Answered
		if (isAnswerStatus(answer, AnswerStatus.NOTAPPLICABLE))
		{
			DynamicGridColumn columnNASelect = this.grid.getColumns().getByIdentifier(SELECT_NA_COLUMN);
			if (columnNASelect != null)
			{
				DynamicGridCell cellNASelect = row.getCells().get(columnNASelect);
				if (cellNASelect.getValue() instanceof Boolean && ((Boolean) cellNASelect.getValue()).booleanValue())
					answer.setIsAnswered(AnswerStatus.ANSWERED);
			}
		}
	}

	return voPatientAssessment;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateUserAssessment(Patient_AssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	populateGridHeaderAndFooter(data.getUserAssessment());

	if (isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if (isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);

		if (isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private Patient_AssessmentGroupVoCollection filterUnanswered(Patient_AssessmentGroupVoCollection answers)
{
	if (answers == null)
		return null;

	for (int i = 0; i < answers.size(); i++)
	{
		for (int j = 0; j < answers.get(i).getAssessmentAnswers().size(); j++)
		{
			Patient_AssessmentQuestionVo q = answers.get(i).getAssessmentAnswers().get(j);

			q.setIsAnswered(isAnswered(q) ? AnswerStatus.ANSWERED : AnswerStatus.NOTANSWERED);
		}
	}
	return answers;
}
 
Example 27
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void populateUserAssessment(PatientAssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);		
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();				
	
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	
	if(isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if(isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);		
		
		if(isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 28
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void populateUserAssessment(Patient_AssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);		
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();				
	
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	
	if(isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if(isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);		
		
		if(isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVoCollection setAsNotAnswerdNonStandardQuestions(UserAssessmentVo voUserAssessment, PatientAssessmentGroupVoCollection voPatAssGroupVoColl)
{
	if(voUserAssessment == null || voPatAssGroupVoColl == null)
		return voPatAssGroupVoColl;
	
	for (int i = 0; voPatAssGroupVoColl != null && i < voPatAssGroupVoColl.size(); i++)
	{
		for (int j = 0; j < voPatAssGroupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			AssessmentQuestionVo voAssQuestion = voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).getAssessmentQuestion();
			if(voAssQuestion.getIsNonStandardIsNotNull() && voAssQuestion.getIsNonStandard().booleanValue())
			{
				voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).setIsAnswered(AnswerStatus.NOTANSWERED);
			}
			
		}
	}
	
	return voPatAssGroupVoColl;
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   View source code 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 31
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void populateUserAssessment(PatientAssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	populateGridHeaderAndFooter(data.getUserAssessment());

	if (isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if (isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);

		if (isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVoCollection filterUnanswered(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return null;

	for (int i = 0; i < answers.size(); i++)
	{
		for (int j = 0; j < answers.get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo q = answers.get(i).getAssessmentAnswers().get(j);

			q.setIsAnswered(isAnswered(q) ? AnswerStatus.ANSWERED : AnswerStatus.NOTANSWERED);
		}
	}
	return answers;
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
public PatientAssessmentVo updateNotApplicableQuestionStatus(PatientAssessmentVo voPatientAssessment)
{
	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);

		AssessmentQuestionVo question = (AssessmentQuestionVo) row.getIdentifier();
		PatientAssessmentQuestionVo answer = findAnswer(voPatientAssessment.getAssessmentData().getAnswerGroups(), question);
		if (answer == null)
			throw new CodingRuntimeException("Unable to find an answer for '" + question.getQuestion().getText() + "' question.");
		// Change the status from Non Applicable to Answered
		if (isAnswerStatus(answer, AnswerStatus.NOTAPPLICABLE))
		{
			DynamicGridColumn columnNASelect = this.grid.getColumns().getByIdentifier(SELECT_NA_COLUMN);
			if (columnNASelect != null)
			{
				DynamicGridCell cellNASelect = row.getCells().get(columnNASelect);
				if (cellNASelect.getValue() instanceof Boolean && ((Boolean) cellNASelect.getValue()).booleanValue())
					answer.setIsAnswered(AnswerStatus.ANSWERED);
			}
		}
	}

	return voPatientAssessment;
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void populateUserAssessment(Patient_AssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	populateGridHeaderAndFooter(data.getUserAssessment());

	if (isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if (isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);

		if (isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 35
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private Patient_AssessmentGroupVoCollection filterUnanswered(Patient_AssessmentGroupVoCollection answers)
{
	if (answers == null)
		return null;

	for (int i = 0; i < answers.size(); i++)
	{
		for (int j = 0; j < answers.get(i).getAssessmentAnswers().size(); j++)
		{
			Patient_AssessmentQuestionVo q = answers.get(i).getAssessmentAnswers().get(j);

			q.setIsAnswered(isAnswered(q) ? AnswerStatus.ANSWERED : AnswerStatus.NOTANSWERED);
		}
	}
	return answers;
}
 
Example 36
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void populateUserAssessment(PatientAssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);		
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();				
	
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	
	if(isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if(isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);		
		
		if(isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 37
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private void populateUserAssessment(Patient_AssessmentDataVo data, PatientAssessmentStatusReason status, AnswerStatus answerStatus) throws PresentationLogicException
{
	checkDataIntegrity(data);		
	boolean isFlatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean isMultiGroup = data.getUserAssessment().getIsMultipleGroup().booleanValue();				
	
	prepareGrid(isFlatView, data.getGroupQuestionWidth(), isCompleted(status));
	
	if(isDPP)
	{
		populateQuestionsFlat(data, answerStatus);
		setAnswersFlat(data.getAnswerGroups());
	}
	else
	{
		if(isMultiGroup && isFlatView)
			populateQuestionsFlat(data, null);
		else
			populateQuestionsHierarchical(data);		
		
		if(isFlatView)
			setAnswersFlat(data.getAnswerGroups());
		else
			setAnswersHierarchical(data.getAnswerGroups());
	}
}
 
Example 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onBtnSelectNAQuestionsClick() throws PresentationLogicException
{
	PatientAssessmentVo currentAssessment = form.getLocalContext().getPatientAssessmentVo();
	//Get the changes user eventualy made in the questions
	//updatePatientAssessmentWithTheChanges(currentAssessment);
	UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabNonApplicable().dynNonApplic());
	currentAssessment = helper.updateQuestionStatusToAnswered(currentAssessment, AnswerStatus.NOTAPPLICABLE);
	
	form.getLocalContext().setPatientAssessmentVo(currentAssessment);
	populateQuestionsGrid(filterQuestions(currentAssessment, DPP));
	form.lyrTabs().showtabCurrent();
	enableContextMenu();
}
 
Example 39
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void removeNotAnswered(PatientAssessmentGroupVoCollection answerGroups)
{
	boolean deleted = true;
	while (deleted)
	{
		deleted = false;
		for (int i = 0; answerGroups != null && i < answerGroups.size(); i++)
		{
			for (int j = 0; j < answerGroups.get(i).getAssessmentAnswers().size(); j++)
			{
				AnswerStatus answerStatus = answerGroups.get(i).getAssessmentAnswers().get(j).getIsAnswered();
				// Exclude the Answered ones
				if (answerStatus != null && answerStatus.equals(AnswerStatus.ANSWERED) == false)
				{
					deleted = true;
				}

				if(deleted)
				{
					answerGroups.get(i).getAssessmentAnswers().remove(j);
					break;
				}
			}
			if (deleted)
				break;
		}
	}
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onBtnSelectNSQuestionsClick() throws PresentationLogicException
{
	PatientAssessmentVo currentAssessment = form.getLocalContext().getPatientAssessmentVo();
	//Get the changes user eventualy made in the questions
	//updatePatientAssessmentWithTheChanges(currentAssessment);
	UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabStandardQuestion().dyngrdNonStandard());
	currentAssessment = helper.updateQuestionStatusToAnswered(currentAssessment, AnswerStatus.NOTANSWERED);
	
	form.getLocalContext().setPatientAssessmentVo(currentAssessment);
	currentAssessment = filterQuestions(currentAssessment, DPP);
	populateQuestionsGrid(currentAssessment);
	form.lyrTabs().showtabCurrent();
	enableContextMenu();
}