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   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 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   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 15
Project: AvoinApotti   File: Logic.java   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   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 20
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 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   Source Code and License 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   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 23
Project: openMAXIMS   File: Logic.java   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   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 34
Project: openMAXIMS   File: Logic.java   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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 41
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 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 42
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 43
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean hasMandatoryAnswers(PatientAssessmentQuestionVo assessmentQuestion)
{
	if (assessmentQuestion == null)
		return false;

	for (int j = 0; j < assessmentQuestion.getPatientAnswers().size(); j++)
	{
		PatientAssessmentAnswerVo voPAA = assessmentQuestion.getPatientAnswers().get(j);
		for (int k = 0; k < voPAA.getAnswerDetails().size(); k++)
		{
			if (voPAA.getAnswerDetails().get(k).getAnswerType().getIsMandatoryIsNotNull() && voPAA.getAnswerDetails().get(k).getAnswerType().getIsMandatory().booleanValue())
			{
				return true;
			}
		}
	}

	return false;
}
 
Example 44
Project: openMAXIMS   File: Logic.java   Source Code and License 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 45
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 46
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 47
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 48
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 49
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 50
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 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 51
Project: openMAXIMS   File: Logic.java   Source Code and License 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 52
Project: openMAXIMS   File: Logic.java   Source Code and License 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 53
Project: openMAXIMS   File: Logic.java   Source Code and License 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 54
Project: openMAXIMS   File: Logic.java   Source Code and License 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 55
Project: openMAXIMS   File: Logic.java   Source Code and License 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 56
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 57
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 58
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 59
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 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getAnswerText(PatientAssessmentQuestionVo voAnswer)
{
	if(voAnswer != null)
	{
		return UserAssessmentInstHelper.getDPPQuestionAndAnswers(voAnswer);
	}
	
	return "";
}