Java Code Examples for ims.assessment.vo.PatientAssessmentQuestionVo.setIsAnswered()

The following are Jave code examples for showing how to use setIsAnswered() of the ims.assessment.vo.PatientAssessmentQuestionVo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 3
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
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 4
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
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 5
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
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 6
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
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 7
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
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 8
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 6 votes
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 9
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 6 votes
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 10
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License Vote up 5 votes
public PatientAssessmentVo updateQuestionStatusToAnswered(PatientAssessmentVo voPatientAssessment, AnswerStatus status)
{
	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.");
		if(status == null)
			throw new CodingRuntimeException("No status provided for '" + question.getQuestion().getText() + "' question.");
		//Change the status from Non Applicable to Answered
		if(isAnswerStatus(answer, status))
		{
			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 11
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License Vote up 5 votes
public PatientAssessmentVo updateQuestionStatusToAnswered(PatientAssessmentVo voPatientAssessment, AnswerStatus status)
{
	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.");
		if(status == null)
			throw new CodingRuntimeException("No status provided for '" + question.getQuestion().getText() + "' question.");
		//Change the status from Non Applicable to Answered
		if(isAnswerStatus(answer, status))
		{
			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 12
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License Vote up 5 votes
public PatientAssessmentVo updateQuestionStatusToAnswered(PatientAssessmentVo voPatientAssessment, AnswerStatus status)
{
	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.");
		if(status == null)
			throw new CodingRuntimeException("No status provided for '" + question.getQuestion().getText() + "' question.");
		//Change the status from Non Applicable to Answered
		if(isAnswerStatus(answer, status))
		{
			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 13
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License Vote up 5 votes
public PatientAssessmentVo updateQuestionStatusToAnswered(PatientAssessmentVo voPatientAssessment, AnswerStatus status)
{
	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.");
		if(status == null)
			throw new CodingRuntimeException("No status provided for '" + question.getQuestion().getText() + "' question.");
		//Change the status from Non Applicable to Answered
		if(isAnswerStatus(answer, status))
		{
			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;
}