Java Code Examples for ims.assessment.vo.PatientAssessmentGroupVoCollection

The following are top voted examples for showing how to use ims.assessment.vo.PatientAssessmentGroupVoCollection. 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 PatientAssessmentGroupVoCollection setAsNotAnswerdNonStandardQuestions(UserAssessmentVo voUserAssessment, PatientAssessmentGroupVoCollection voPatAssGroupVoColl)
{
	if(voUserAssessment == null || voPatAssGroupVoColl == null)
		return voPatAssGroupVoColl;
	
	for (int i = 0; voPatAssGroupVoColl != null && i < voPatAssGroupVoColl.size(); i++)
	{
		for (int j = 0; j < voPatAssGroupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			AssessmentQuestionVo voAssQuestion = voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).getAssessmentQuestion();
			if(voAssQuestion.getIsNonStandardIsNotNull() && voAssQuestion.getIsNonStandard().booleanValue())
			{
				voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).setIsAnswered(AnswerStatus.NOTANSWERED);
			}
			
		}
	}
	
	return voPatAssGroupVoColl;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   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 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswers()
{
	PatientAssessmentVo currentAssessment = form.getLocalContext().getCurrentAssessment();
	PatientAssessmentDataVo assessmentData = currentAssessment.getAssessmentData();
	UserAssessmentInstHelperInternal helper = getHelper(false,form.getLocalContext().getPatientInfo());
	PatientAssessmentGroupVoCollection currentAnswer = helper.getAnswers(assessmentData.getAnswerGroups());
	assessmentData.setAnswerGroups(currentAnswer);
	//WDEV-11675 -Start Calculate total score
	float totalScore = 0;
	for (int i = 0 ; currentAnswer!=null && i < currentAnswer.size(); i++)
	{
		if (currentAnswer.get(i).getCurrentScore()!=null)
		{
			totalScore+=currentAnswer.get(i).getCurrentScore();
		}
	}
	currentAssessment.setScore(totalScore);
	//WDEV-11675 - End
	form.getLocalContext().setCurrentAssessment(currentAssessment);
}
 
Example 4
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 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public String[] validateData()
{
	PatientAssessmentGroupVoCollection answers = getAnswers(null);

	if (answers == null)
		return null;

	ArrayList<String> errors = new ArrayList<String>();
	for (int x = 0; x < answers.size(); x++)
	{
		errors = validateAnswer(answers.get(x), errors);
	}

	if (errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}

	return null;
}
 
Example 6
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 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for (int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y), answerGroup);
			}
		}
	}
}
 
Example 8
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public String[] validateData()
{
		PatientAssessmentGroupVoCollection answers = getAnswers(null);
	
	if(answers == null)
		return null;

	ArrayList errors = new ArrayList();
	for(int x = 0; x < answers.size(); x++)
	{			
		errors = validateAnswer(answers.get(x), errors);
	}
	
	if(errors.size() > 0)
	{
		String[] result = new String[errors.size()];			
		errors.toArray(result);
		return result;
	}
	
	return null;
}
 
Example 9
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 10
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for(int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y));
			}
		}
	}
}
 
Example 11
Project: AvoinApotti   File: DailyPatientProgressHelper.java   Source Code and License 6 votes vote down vote up
public void populateTreeScores(ims.framework.controls.TreeView tree, PatientAssessmentGroupVoCollection voColl)
{
	if(tree == null)
		return;
	
	TotalScore totalScore = getTotalScore(voColl);
	
	if(totalScore != null)
	{
		TreeNode node = tree.getNodes().add(new Integer(RED_SCORE), "(" + Integer.toString(totalScore.getRedScore()) + ") Red");
		node.setExpandedImage(redImage);
		node.setCollapsedImage(redImage);
		node = tree.getNodes().add(new Integer(YELLOW_SCORE), "(" + Integer.toString(totalScore.getYellowScore()) + ") Yellow");
		node.setExpandedImage(yellowImage);
		node.setCollapsedImage(yellowImage);
		node = tree.getNodes().add(new Integer(GREEN_SCORE), "(" + Integer.toString(totalScore.getGreenScore()) + ") Green");
		node.setExpandedImage(greenImage);
		node.setCollapsedImage(greenImage);
		node = tree.getNodes().add(null, "Total Score: " + totalScore.getTotalScore());
		node.setTextColor(Color.Blue);
	}
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentVo getNewPatientAssessment(PatientAssessmentVo voPatientAssessment) throws PresentationLogicException
{
	UserAssessmentVo voUserAssessment = form.getGlobalContext().Nursing.getUserAssessmentDPP();
	if (voUserAssessment != null)
	{
		voPatientAssessment = new PatientAssessmentVo();
		UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabCurrent().dynQuestions());
		helper.populate(voUserAssessment);
		
		PatientAssessmentDataVo assessmentData = new PatientAssessmentDataVo();
		assessmentData.setUserAssessment(voUserAssessment);
		PatientAssessmentGroupVoCollection voColl = helper.getAnswers(assessmentData.getAnswerGroups());
		voColl = setAsNotAnswerdNonStandardQuestions(voUserAssessment, voColl);
		assessmentData.setAnswerGroups(voColl);
		
		voPatientAssessment.setAssessmentData(assessmentData);
		form.getLocalContext().setPatientAssessmentVo(voPatientAssessment);
	}
	else
	{
		throw new CodingRuntimeException("Cannot Instantiate data with null Daily Patient Record.");
	}
	return voPatientAssessment;
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentGroupVoCollection setAsNotAnswerdNonStandardQuestions(UserAssessmentVo voUserAssessment, PatientAssessmentGroupVoCollection voPatAssGroupVoColl)
{
	if(voUserAssessment == null || voPatAssGroupVoColl == null)
		return voPatAssGroupVoColl;
	
	for (int i = 0; voPatAssGroupVoColl != null && i < voPatAssGroupVoColl.size(); i++)
	{
		for (int j = 0; j < voPatAssGroupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			AssessmentQuestionVo voAssQuestion = voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).getAssessmentQuestion();
			if(voAssQuestion.getIsNonStandardIsNotNull() && voAssQuestion.getIsNonStandard().booleanValue())
			{
				voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).setIsAnswered(AnswerStatus.NOTANSWERED);
			}
			
		}
	}
	
	return voPatAssGroupVoColl;
}
 
Example 14
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 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswers()
{
	PatientAssessmentVo currentAssessment = form.getLocalContext().getCurrentAssessment();
	PatientAssessmentDataVo assessmentData = currentAssessment.getAssessmentData();
	UserAssessmentInstHelperInternal helper = getHelper(false,form.getLocalContext().getPatientInfo());
	PatientAssessmentGroupVoCollection currentAnswer = helper.getAnswers(assessmentData.getAnswerGroups());
	assessmentData.setAnswerGroups(currentAnswer);
	//WDEV-11675 -Start Calculate total score
	float totalScore = 0;
	for (int i = 0 ; currentAnswer!=null && i < currentAnswer.size(); i++)
	{
		if (currentAnswer.get(i).getCurrentScore()!=null)
		{
			totalScore+=currentAnswer.get(i).getCurrentScore();
		}
	}
	currentAssessment.setScore(totalScore);
	//WDEV-11675 - End
	form.getLocalContext().setCurrentAssessment(currentAssessment);
}
 
Example 16
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 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public String[] validateData()
{
	PatientAssessmentGroupVoCollection answers = getAnswers(null);

	if (answers == null)
		return null;

	ArrayList<String> errors = new ArrayList<String>();
	for (int x = 0; x < answers.size(); x++)
	{
		errors = validateAnswer(answers.get(x), errors);
	}

	if (errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}

	return null;
}
 
Example 18
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 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for (int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y), answerGroup);
			}
		}
	}
}
 
Example 20
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public String[] validateData()
{
		PatientAssessmentGroupVoCollection answers = getAnswers(null);
	
	if(answers == null)
		return null;

	ArrayList errors = new ArrayList();
	for(int x = 0; x < answers.size(); x++)
	{			
		errors = validateAnswer(answers.get(x), errors);
	}
	
	if(errors.size() > 0)
	{
		String[] result = new String[errors.size()];			
		errors.toArray(result);
		return result;
	}
	
	return null;
}
 
Example 21
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 22
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for(int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y));
			}
		}
	}
}
 
Example 23
Project: openMAXIMS   File: DailyPatientProgressHelper.java   Source Code and License 6 votes vote down vote up
public void populateTreeScores(ims.framework.controls.TreeView tree, PatientAssessmentGroupVoCollection voColl)
{
	if(tree == null)
		return;
	
	TotalScore totalScore = getTotalScore(voColl);
	
	if(totalScore != null)
	{
		TreeNode node = tree.getNodes().add(new Integer(RED_SCORE), "(" + Integer.toString(totalScore.getRedScore()) + ") Red");
		node.setExpandedImage(redImage);
		node.setCollapsedImage(redImage);
		node = tree.getNodes().add(new Integer(YELLOW_SCORE), "(" + Integer.toString(totalScore.getYellowScore()) + ") Yellow");
		node.setExpandedImage(yellowImage);
		node.setCollapsedImage(yellowImage);
		node = tree.getNodes().add(new Integer(GREEN_SCORE), "(" + Integer.toString(totalScore.getGreenScore()) + ") Green");
		node.setExpandedImage(greenImage);
		node.setCollapsedImage(greenImage);
		node = tree.getNodes().add(null, "Total Score: " + totalScore.getTotalScore());
		node.setTextColor(Color.Blue);
	}
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentVo getNewPatientAssessment(PatientAssessmentVo voPatientAssessment) throws PresentationLogicException
{
	UserAssessmentVo voUserAssessment = form.getGlobalContext().Nursing.getUserAssessmentDPP();
	if (voUserAssessment != null)
	{
		voPatientAssessment = new PatientAssessmentVo();
		UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabCurrent().dynQuestions());
		helper.populate(voUserAssessment);
		
		PatientAssessmentDataVo assessmentData = new PatientAssessmentDataVo();
		assessmentData.setUserAssessment(voUserAssessment);
		PatientAssessmentGroupVoCollection voColl = helper.getAnswers(assessmentData.getAnswerGroups());
		voColl = setAsNotAnswerdNonStandardQuestions(voUserAssessment, voColl);
		assessmentData.setAnswerGroups(voColl);
		
		voPatientAssessment.setAssessmentData(assessmentData);
		form.getLocalContext().setPatientAssessmentVo(voPatientAssessment);
	}
	else
	{
		throw new CodingRuntimeException("Cannot Instantiate data with null Daily Patient Record.");
	}
	return voPatientAssessment;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentGroupVoCollection setAsNotAnswerdNonStandardQuestions(UserAssessmentVo voUserAssessment, PatientAssessmentGroupVoCollection voPatAssGroupVoColl)
{
	if(voUserAssessment == null || voPatAssGroupVoColl == null)
		return voPatAssGroupVoColl;
	
	for (int i = 0; voPatAssGroupVoColl != null && i < voPatAssGroupVoColl.size(); i++)
	{
		for (int j = 0; j < voPatAssGroupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			AssessmentQuestionVo voAssQuestion = voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).getAssessmentQuestion();
			if(voAssQuestion.getIsNonStandardIsNotNull() && voAssQuestion.getIsNonStandard().booleanValue())
			{
				voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).setIsAnswered(AnswerStatus.NOTANSWERED);
			}
			
		}
	}
	
	return voPatAssGroupVoColl;
}
 
Example 26
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 27
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswers()
{
	PatientAssessmentVo currentAssessment = form.getLocalContext().getCurrentAssessment();
	PatientAssessmentDataVo assessmentData = currentAssessment.getAssessmentData();
	UserAssessmentInstHelperInternal helper = getHelper(false,form.getLocalContext().getPatientInfo());
	PatientAssessmentGroupVoCollection currentAnswer = helper.getAnswers(assessmentData.getAnswerGroups());
	assessmentData.setAnswerGroups(currentAnswer);
	//WDEV-11675 -Start Calculate total score
	float totalScore = 0;
	for (int i = 0 ; currentAnswer!=null && i < currentAnswer.size(); i++)
	{
		if (currentAnswer.get(i).getCurrentScore()!=null)
		{
			totalScore+=currentAnswer.get(i).getCurrentScore();
		}
	}
	currentAssessment.setScore(totalScore);
	//WDEV-11675 - End
	form.getLocalContext().setCurrentAssessment(currentAssessment);
}
 
Example 28
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 29
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public String[] validateData()
{
	PatientAssessmentGroupVoCollection answers = getAnswers(null);

	if (answers == null)
		return null;

	ArrayList<String> errors = new ArrayList<String>();
	for (int x = 0; x < answers.size(); x++)
	{
		errors = validateAnswer(answers.get(x), errors);
	}

	if (errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}

	return null;
}
 
Example 30
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 31
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if (answers == null)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if (answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for (int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y), answerGroup);
			}
		}
	}
}
 
Example 32
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public String[] validateData()
{
		PatientAssessmentGroupVoCollection answers = getAnswers(null);
	
	if(answers == null)
		return null;

	ArrayList errors = new ArrayList();
	for(int x = 0; x < answers.size(); x++)
	{			
		errors = validateAnswer(answers.get(x), errors);
	}
	
	if(errors.size() > 0)
	{
		String[] result = new String[errors.size()];			
		errors.toArray(result);
		return result;
	}
	
	return null;
}
 
Example 33
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 34
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void setAnswersFlat(PatientAssessmentGroupVoCollection answers)
{
	if(answers == null)
		return;
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientAssessmentGroupVo answerGroup = answers.get(x);
		if(answerGroup != null && answerGroup.getAssessmentAnswersIsNotNull())
		{
			for(int y = 0; y < answerGroup.getAssessmentAnswers().size(); y++)
			{
				setQuestionRowAnswer(null, answerGroup.getAssessmentAnswers().get(y));
			}
		}
	}
}
 
Example 35
Project: openMAXIMS   File: DailyPatientProgressHelper.java   Source Code and License 6 votes vote down vote up
public void populateTreeScores(ims.framework.controls.TreeView tree, PatientAssessmentGroupVoCollection voColl)
{
	if(tree == null)
		return;
	
	TotalScore totalScore = getTotalScore(voColl);
	
	if(totalScore != null)
	{
		TreeNode node = tree.getNodes().add(new Integer(RED_SCORE), "(" + Integer.toString(totalScore.getRedScore()) + ") Red");
		node.setExpandedImage(redImage);
		node.setCollapsedImage(redImage);
		node = tree.getNodes().add(new Integer(YELLOW_SCORE), "(" + Integer.toString(totalScore.getYellowScore()) + ") Yellow");
		node.setExpandedImage(yellowImage);
		node.setCollapsedImage(yellowImage);
		node = tree.getNodes().add(new Integer(GREEN_SCORE), "(" + Integer.toString(totalScore.getGreenScore()) + ") Green");
		node.setExpandedImage(greenImage);
		node.setCollapsedImage(greenImage);
		node = tree.getNodes().add(null, "Total Score: " + totalScore.getTotalScore());
		node.setTextColor(Color.Blue);
	}
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentVo getNewPatientAssessment(PatientAssessmentVo voPatientAssessment) throws PresentationLogicException
{
	UserAssessmentVo voUserAssessment = form.getGlobalContext().Nursing.getUserAssessmentDPP();
	if (voUserAssessment != null)
	{
		voPatientAssessment = new PatientAssessmentVo();
		UserAssessmentInstHelper helper = getHelper(form.lyrTabs().tabCurrent().dynQuestions());
		helper.populate(voUserAssessment);
		
		PatientAssessmentDataVo assessmentData = new PatientAssessmentDataVo();
		assessmentData.setUserAssessment(voUserAssessment);
		PatientAssessmentGroupVoCollection voColl = helper.getAnswers(assessmentData.getAnswerGroups());
		voColl = setAsNotAnswerdNonStandardQuestions(voUserAssessment, voColl);
		assessmentData.setAnswerGroups(voColl);
		
		voPatientAssessment.setAssessmentData(assessmentData);
		form.getLocalContext().setPatientAssessmentVo(voPatientAssessment);
	}
	else
	{
		throw new CodingRuntimeException("Cannot Instantiate data with null Daily Patient Record.");
	}
	return voPatientAssessment;
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientAssessmentGroupVoCollection setAsNotAnswerdNonStandardQuestions(UserAssessmentVo voUserAssessment, PatientAssessmentGroupVoCollection voPatAssGroupVoColl)
{
	if(voUserAssessment == null || voPatAssGroupVoColl == null)
		return voPatAssGroupVoColl;
	
	for (int i = 0; voPatAssGroupVoColl != null && i < voPatAssGroupVoColl.size(); i++)
	{
		for (int j = 0; j < voPatAssGroupVoColl.get(i).getAssessmentAnswers().size(); j++)
		{
			AssessmentQuestionVo voAssQuestion = voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).getAssessmentQuestion();
			if(voAssQuestion.getIsNonStandardIsNotNull() && voAssQuestion.getIsNonStandard().booleanValue())
			{
				voPatAssGroupVoColl.get(i).getAssessmentAnswers().get(j).setIsAnswered(AnswerStatus.NOTANSWERED);
			}
			
		}
	}
	
	return voPatAssGroupVoColl;
}
 
Example 38
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 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setAnswers()
{
	PatientAssessmentVo currentAssessment = form.getLocalContext().getCurrentAssessment();
	PatientAssessmentDataVo assessmentData = currentAssessment.getAssessmentData();
	UserAssessmentInstHelperInternal helper = getHelper(false,form.getLocalContext().getPatientInfo());
	PatientAssessmentGroupVoCollection currentAnswer = helper.getAnswers(assessmentData.getAnswerGroups());
	assessmentData.setAnswerGroups(currentAnswer);
	//WDEV-11675 -Start Calculate total score
	float totalScore = 0;
	for (int i = 0 ; currentAnswer!=null && i < currentAnswer.size(); i++)
	{
		if (currentAnswer.get(i).getCurrentScore()!=null)
		{
			totalScore+=currentAnswer.get(i).getCurrentScore();
		}
	}
	currentAssessment.setScore(totalScore);
	//WDEV-11675 - End
	form.getLocalContext().setCurrentAssessment(currentAssessment);
}
 
Example 40
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;
}