Java Code Examples for ims.assessment.vo.PatientAssessmentQuestionVo

The following are top voted examples for showing how to use ims.assessment.vo.PatientAssessmentQuestionVo. 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 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   View source code 6 votes vote down vote up
private void setPOCData(PlanOfCareVoCollection pocVoColl, PatientAssessmentVo voPatAssessment)
{
	if(voPatAssessment == null)
		return;
	PatientAssessmentDataVo assessmentData = voPatAssessment.getAssessmentData();
	if(assessmentData == null)
		return;
	for (int i = 0; i < assessmentData.getAnswerGroups().size(); i++)
	{
		for (int j = 0; j < assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssQuestionVo = assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().get(j);
			Boolean isPocSaved = getPocValue(voPatAssQuestionVo.getAssessmentQuestion(), pocVoColl);
			voPatAssQuestionVo.setIsPoc(isPocSaved);
			voPatAssQuestionVo.setIsPocSaved(isPocSaved);
			assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().set(j, voPatAssQuestionVo);
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean hasAnswers(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return false;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return answerDetail.getMultiSelectAnswers().size() > 0;
			}
		}
	}
	return false;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean hasAnswers(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return false;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return answerDetail.getMultiSelectAnswers().size() > 0;
			}
		}
	}
	return false;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVo getMultiSelectAnswer(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return null;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return voAssessQuestion.getPatientAnswers().get(i);
			}
		}
	}
	return null;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private AuthoringInformationVo getAuthoringInfoForMultiSelectAnswer(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return null;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return voAssessQuestion.getPatientAnswers().get(i).getAuthoringInfo();
			}
		}
	}
	return null;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isConfirmed(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return false;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return voAssessQuestion.getPatientAnswers().get(i).getConfirmingInfoIsNotNull();
			}
		}
	}
	return false;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void setPOCData(PlanOfCareVoCollection pocVoColl, PatientAssessmentVo voPatAssessment)
{
	if(voPatAssessment == null)
		return;
	PatientAssessmentDataVo assessmentData = voPatAssessment.getAssessmentData();
	if(assessmentData == null)
		return;
	for (int i = 0; i < assessmentData.getAnswerGroups().size(); i++)
	{
		for (int j = 0; j < assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssQuestionVo = assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().get(j);
			voPatAssQuestionVo.setIsPoc(getPocValue(voPatAssQuestionVo.getAssessmentQuestion(), pocVoColl));
			assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().set(j, voPatAssQuestionVo);
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private String getInitialsTooltip(PatientAssessmentQuestionVo voPatAssQuestion)
{
	if (voPatAssQuestion != null && voPatAssQuestion.getPatientAnswers().size() > 0)
	{
		StringBuffer tooltip = new StringBuffer();
		PatientAssessmentAnswerVo voPatAssessmentAnswer = getMultiSelectAnswer(voPatAssQuestion);
		if (voPatAssessmentAnswer != null)
		{
			AuthoringInformationVo voAuthoring = voPatAssessmentAnswer.getAuthoringInfo();
			if (voAuthoring != null)
			{
				tooltip.append("*Authoring Information:* ");
				tooltip.append(voAuthoring.toString(", "));
			}
			AuthoringInformationVo voConfirming = voPatAssessmentAnswer.getConfirmingInfo();
			if (voConfirming != null)
			{
				tooltip.append("\n");
				tooltip.append("*Confirming Information:* ");
				tooltip.append(voConfirming.toString(", "));
			}
			return new Textile().process(tooltip.toString());
		}
	}
	return "";
}
 
Example 10
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 11
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findAnswer(PatientAssessmentGroupVoCollection groupVoColl, AssessmentQuestionVo question)
{
	if (groupVoColl == null || question == null)
		return null;

	for (int i = 0; i < groupVoColl.size(); i++)
	{
		for (int j = 0; j < groupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo answer = groupVoColl.get(i).getAssessmentAnswers().get(j);
			AssessmentQuestionVo assessmentQuestion = answer.getAssessmentQuestion();
			if (assessmentQuestion != null && assessmentQuestion.equals(question))
				return answer;
		}

	}
	return null;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if (assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();

	for (int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if (assessmentQuestion != null && assessmentQuestion.getAssessmentQuestionIsNotNull() && assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}

	return new PatientAssessmentQuestionVo();
}
 
Example 13
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 14
Project: AvoinApotti   File: Logic.java   View source code 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 15
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentQuestionVo instQuestion, QuestionAnswerTypeVo configAnswerType)
{
	if (instQuestion == null || instQuestion.getPatientAnswers() == null || instQuestion.getPatientAnswers().size() == 0 || configAnswerType == null)
		return null;

	for (int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);
		if (answer != null && answer.getAnswerDetails() != null)
		{
			for (int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if (answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}
	}

	return null;
}
 
Example 16
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateAnswer(PatientAssessmentQuestionVo assessmentQuestion, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	
	if(assessmentQuestion == null || assessmentQuestion.getAssessmentQuestion() == null || assessmentQuestion.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = assessmentQuestion.getAssessmentQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = assessmentQuestion.getPatientAnswers();
	Boolean isMandatory = assessmentQuestion.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);			
	
	return errors;
}
 
Example 17
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findAnswer(PatientAssessmentGroupVoCollection groupVoColl, AssessmentQuestionVo question)
{
	if (groupVoColl == null || question == null)
		return null;
	
	for (int i = 0; i < groupVoColl.size(); i++)
	{
		for (int j = 0; j < groupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo answer = groupVoColl.get(i).getAssessmentAnswers().get(j);
			AssessmentQuestionVo assessmentQuestion = answer.getAssessmentQuestion();
			if (assessmentQuestion != null && assessmentQuestion.equals(question))
				return answer;
		}

	}
	return null;
}
 
Example 18
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if(assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();
	
	for(int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if(assessmentQuestion != null 
				&& assessmentQuestion.getAssessmentQuestionIsNotNull()
				&& assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}
	
	return new PatientAssessmentQuestionVo();
}
 
Example 19
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 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 20
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentQuestionVo instQuestion, QuestionAnswerTypeVo configAnswerType)
{
	if(instQuestion == null || instQuestion.getPatientAnswers() == null || instQuestion.getPatientAnswers().size() == 0 || configAnswerType == null)
		return null;
	
	for(int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);		
		if(answer != null && answer.getAnswerDetails() != null)
		{
			for(int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if(answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}		
	}
	
	return null;
}
 
Example 21
Project: AvoinApotti   File: DailyPatientProgressHelper.java   View source code 6 votes vote down vote up
private boolean hasAnswers(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return false;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return answerDetail.getMultiSelectAnswers().size() > 0;
			}
		}
	}
	return false;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 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 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean hasAnswers(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return false;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return answerDetail.getMultiSelectAnswers().size() > 0;
			}
		}
	}
	return false;
}
 
Example 24
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean isConfirmed(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return false;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return voAssessQuestion.getPatientAnswers().get(i).getConfirmingInfoIsNotNull();
			}
		}
	}
	return false;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean hasAnswers(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return false;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return answerDetail.getMultiSelectAnswers().size() > 0;
			}
		}
	}
	return false;
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVo getMultiSelectAnswer(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return null;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return voAssessQuestion.getPatientAnswers().get(i);
			}
		}
	}
	return null;
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isConfirmed(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return false;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return voAssessQuestion.getPatientAnswers().get(i).getConfirmingInfoIsNotNull();
			}
		}
	}
	return false;
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void setPOCData(PlanOfCareVoCollection pocVoColl, PatientAssessmentVo voPatAssessment)
{
	if(voPatAssessment == null)
		return;
	PatientAssessmentDataVo assessmentData = voPatAssessment.getAssessmentData();
	if(assessmentData == null)
		return;
	for (int i = 0; i < assessmentData.getAnswerGroups().size(); i++)
	{
		for (int j = 0; j < assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssQuestionVo = assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().get(j);
			voPatAssQuestionVo.setIsPoc(getPocValue(voPatAssQuestionVo.getAssessmentQuestion(), pocVoColl));
			assessmentData.getAnswerGroups().get(i).getAssessmentAnswers().set(j, voPatAssQuestionVo);
		}
	}
}
 
Example 29
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 30
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVo getMultiSelectAnswer(PatientAssessmentQuestionVo voAssessQuestion)
{
	if(voAssessQuestion == null)
		return null;
	
	for (int i = 0; i < voAssessQuestion.getPatientAnswers().size(); i++)
	{
		for (int j = 0; j < voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().size(); j++)
		{
			AnswerDetailsVo answerDetail = voAssessQuestion.getPatientAnswers().get(i).getAnswerDetails().get(j);
			if(isMultiSelectAnswer(answerDetail))
			{
				return voAssessQuestion.getPatientAnswers().get(i);
			}
		}
	}
	return null;
}
 
Example 31
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if (assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();

	for (int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if (assessmentQuestion != null && assessmentQuestion.getAssessmentQuestionIsNotNull() && assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}

	return new PatientAssessmentQuestionVo();
}
 
Example 32
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 33
Project: openMAXIMS   File: Logic.java   View source code 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 34
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentQuestionVo instQuestion, QuestionAnswerTypeVo configAnswerType)
{
	if (instQuestion == null || instQuestion.getPatientAnswers() == null || instQuestion.getPatientAnswers().size() == 0 || configAnswerType == null)
		return null;

	for (int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);
		if (answer != null && answer.getAnswerDetails() != null)
		{
			for (int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if (answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}
	}

	return null;
}
 
Example 35
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if(assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();
	
	for(int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if(assessmentQuestion != null 
				&& assessmentQuestion.getAssessmentQuestionIsNotNull()
				&& assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}
	
	return new PatientAssessmentQuestionVo();
}
 
Example 36
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateAnswer(PatientAssessmentQuestionVo assessmentQuestion, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	
	if(assessmentQuestion == null || assessmentQuestion.getAssessmentQuestion() == null || assessmentQuestion.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = assessmentQuestion.getAssessmentQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = assessmentQuestion.getPatientAnswers();
	Boolean isMandatory = assessmentQuestion.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);			
	
	return errors;
}
 
Example 37
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findAnswer(PatientAssessmentGroupVoCollection groupVoColl, AssessmentQuestionVo question)
{
	if (groupVoColl == null || question == null)
		return null;
	
	for (int i = 0; i < groupVoColl.size(); i++)
	{
		for (int j = 0; j < groupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo answer = groupVoColl.get(i).getAssessmentAnswers().get(j);
			AssessmentQuestionVo assessmentQuestion = answer.getAssessmentQuestion();
			if (assessmentQuestion != null && assessmentQuestion.equals(question))
				return answer;
		}

	}
	return null;
}
 
Example 38
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if(assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();
	
	for(int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if(assessmentQuestion != null 
				&& assessmentQuestion.getAssessmentQuestionIsNotNull()
				&& assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}
	
	return new PatientAssessmentQuestionVo();
}
 
Example 39
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateAnswer(PatientAssessmentQuestionVo assessmentQuestion, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	
	if(assessmentQuestion == null || assessmentQuestion.getAssessmentQuestion() == null || assessmentQuestion.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = assessmentQuestion.getAssessmentQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = assessmentQuestion.getPatientAnswers();
	Boolean isMandatory = assessmentQuestion.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);			
	
	return errors;
}
 
Example 40
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentQuestionVo instQuestion, QuestionAnswerTypeVo configAnswerType)
{
	if(instQuestion == null || instQuestion.getPatientAnswers() == null || instQuestion.getPatientAnswers().size() == 0 || configAnswerType == null)
		return null;
	
	for(int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);		
		if(answer != null && answer.getAnswerDetails() != null)
		{
			for(int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if(answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}		
	}
	
	return null;
}