Java Code Examples for ims.assessment.vo.PatientAssessmentAnswerVoCollection

The following are top voted examples for showing how to use ims.assessment.vo.PatientAssessmentAnswerVoCollection. 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 ArrayList<String> validateGraphicAnswer(PatientGraphicAssessmentQuestionAnswerVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();

	if (answer == null || answer.getGraphicQuestion() == null || answer.getPatientAnswers() == null)
		return errors;

	QuestionInformationVo question = answer.getGraphicQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();

	validateAllAnswers(errors, question, patientAnswers, isMandatory);

	return errors;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if (patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;

	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if (voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}

	return null;
}
 
Example 3
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 4
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicAnswer(PatientGraphicAssessmentQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	
	
	if(answer == null || answer.getGraphicQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicQuestion().getQuestion();
	if (isQuestionInvalidForPatient(question))
		return errors;
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);

	return errors;
}
 
Example 5
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	

	if(answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 6
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(GeneralQuestionAnswerVoCollection categoryQA, QuestionInformationShortVo question)
{
	if (categoryQA == null || categoryQA.size() == 0)
		return null;
	
	if (question == null)
		return null;
	
	for (GeneralQuestionAnswerVo answer : categoryQA)
	{
		if (question.equals(answer.getQuestion()))
			return answer.getPatientAnswers(); 
	}
	
	return null;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(InvestigationQuestionAnswerVoCollection questions, QuestionInformationShortVo question)
{
	if (questions == null || questions.size() == 0)
		return null;

	if (question == null)
		return null;

	for (InvestigationQuestionAnswerVo investigationQuestion : questions)
	{
		if (investigationQuestion.getInvestigationQuestionAnswersIsNotNull())
		{
			for (GeneralQuestionAnswerVo answer : investigationQuestion.getInvestigationQuestionAnswers())
			{
				if (question.equals(answer.getQuestion()))
					return answer.getPatientAnswers();
			}
		}
	}

	return null;
}
 
Example 9
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 10
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private ArrayList<String> validateGraphicAnswer(PatientGraphicAssessmentQuestionAnswerVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();

	if (answer == null || answer.getGraphicQuestion() == null || answer.getPatientAnswers() == null)
		return errors;

	QuestionInformationVo question = answer.getGraphicQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();

	validateAllAnswers(errors, question, patientAnswers, isMandatory);

	return errors;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if (patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;

	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if (voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}

	return null;
}
 
Example 12
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 13
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicAnswer(PatientGraphicAssessmentQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	
	
	if(answer == null || answer.getGraphicQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicQuestion().getQuestion();
	if (isQuestionInvalidForPatient(question))
		return errors;
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);

	return errors;
}
 
Example 14
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	

	if(answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 15
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 16
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(GeneralQuestionAnswerVoCollection categoryQA, QuestionInformationShortVo question)
{
	if (categoryQA == null || categoryQA.size() == 0)
		return null;
	
	if (question == null)
		return null;
	
	for (GeneralQuestionAnswerVo answer : categoryQA)
	{
		if (question.equals(answer.getQuestion()))
			return answer.getPatientAnswers(); 
	}
	
	return null;
}
 
Example 17
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(InvestigationQuestionAnswerVoCollection questions, QuestionInformationShortVo question)
{
	if (questions == null || questions.size() == 0)
		return null;

	if (question == null)
		return null;

	for (InvestigationQuestionAnswerVo investigationQuestion : questions)
	{
		if (investigationQuestion.getInvestigationQuestionAnswersIsNotNull())
		{
			for (GeneralQuestionAnswerVo answer : investigationQuestion.getInvestigationQuestionAnswers())
			{
				if (question.equals(answer.getQuestion()))
					return answer.getPatientAnswers();
			}
		}
	}

	return null;
}
 
Example 18
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(DynamicGridRow gridRow)
{
	PatientAssessmentAnswerVoCollection patientAssAnswerColl = new PatientAssessmentAnswerVoCollection();
	AnswerDetailsVoCollection answerDetails = new AnswerDetailsVoCollection();

	PatientAssessmentAnswerVo voPatientAssessmentAnswer = new PatientAssessmentAnswerVo();

	for (int x = 0; x < form.lyrDetails().tabClinicalDetails().dyngrdQuestions().getColumns().size(); x++)
	{
		DynamicGridCell cell = gridRow.getCells().get(form.lyrDetails().tabClinicalDetails().dyngrdQuestions().getColumns().get(x));

		if (cell != null && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && (cell.getIdentifier() instanceof QuestionAnswerTypeVo || cell.getIdentifier() instanceof AnswerCellData))
		{
			answerDetails.add(getCellAnswer(cell));
		}
	}

	voPatientAssessmentAnswer.setAnswerDetails(answerDetails);
	patientAssAnswerColl.add(voPatientAssessmentAnswer);

	return patientAssAnswerColl;
}
 
Example 20
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void addAnswers(DynamicGridRow row, AssessmentQuestionVo vo, PatientAssessmentAnswerVoCollection patientAnswers)
{
	if (vo == null || vo.getQuestion() == null)
		return;

	if (vo.getQuestion().getAnswerTypesIsNotNull())
	{
		for (int x = 0; x < vo.getQuestion().getAnswerTypes().size(); x++)
		{
			if (Boolean.TRUE.equals(vo.getQuestion().getAnswerTypes().get(x).getActiveStatus()))
			{
				boolean readOnlyCell = false;
				addAnswerCell(row, getAnswerColumn(x), vo.getQuestion().getAnswerTypes().get(x), getInstAnswerType(patientAnswers, vo.getQuestion().getAnswerTypes().get(x)), readOnlyCell);
			}
		}
	}
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if (patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;

	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if (voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}

	return null;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private ArrayList<String> validateGraphicAnswer(PatientGraphicAssessmentQuestionAnswerVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();

	if (answer == null || answer.getGraphicQuestion() == null || answer.getPatientAnswers() == null)
		return errors;

	QuestionInformationVo question = answer.getGraphicQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();

	validateAllAnswers(errors, question, patientAnswers, isMandatory);

	return errors;
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if (patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;

	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if (voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}

	return null;
}
 
Example 24
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 25
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicAnswer(PatientGraphicAssessmentQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	
	
	if(answer == null || answer.getGraphicQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicQuestion().getQuestion();
	if (isQuestionInvalidForPatient(question))
		return errors;
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);

	return errors;
}
 
Example 26
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	

	if(answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 27
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(GeneralQuestionAnswerVoCollection categoryQA, QuestionInformationShortVo question)
{
	if (categoryQA == null || categoryQA.size() == 0)
		return null;
	
	if (question == null)
		return null;
	
	for (GeneralQuestionAnswerVo answer : categoryQA)
	{
		if (question.equals(answer.getQuestion()))
			return answer.getPatientAnswers(); 
	}
	
	return null;
}
 
Example 29
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(InvestigationQuestionAnswerVoCollection questions, QuestionInformationShortVo question)
{
	if (questions == null || questions.size() == 0)
		return null;

	if (question == null)
		return null;

	for (InvestigationQuestionAnswerVo investigationQuestion : questions)
	{
		if (investigationQuestion.getInvestigationQuestionAnswersIsNotNull())
		{
			for (GeneralQuestionAnswerVo answer : investigationQuestion.getInvestigationQuestionAnswers())
			{
				if (question.equals(answer.getQuestion()))
					return answer.getPatientAnswers();
			}
		}
	}

	return null;
}
 
Example 30
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private ArrayList<String> validateGraphicAnswer(PatientGraphicAssessmentQuestionAnswerVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();

	if (answer == null || answer.getGraphicQuestion() == null || answer.getPatientAnswers() == null)
		return errors;

	QuestionInformationVo question = answer.getGraphicQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();

	validateAllAnswers(errors, question, patientAnswers, isMandatory);

	return errors;
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if (patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;

	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if (voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}

	return null;
}
 
Example 33
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 34
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicAnswer(PatientGraphicAssessmentQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	
	
	if(answer == null || answer.getGraphicQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicQuestion().getQuestion();
	if (isQuestionInvalidForPatient(question))
		return errors;
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);

	return errors;
}
 
Example 35
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	

	if(answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 36
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(GeneralQuestionAnswerVoCollection categoryQA, QuestionInformationShortVo question)
{
	if (categoryQA == null || categoryQA.size() == 0)
		return null;
	
	if (question == null)
		return null;
	
	for (GeneralQuestionAnswerVo answer : categoryQA)
	{
		if (question.equals(answer.getQuestion()))
			return answer.getPatientAnswers(); 
	}
	
	return null;
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentAnswerVoCollection getPatientAnswers(InvestigationQuestionAnswerVoCollection questions, QuestionInformationShortVo question)
{
	if (questions == null || questions.size() == 0)
		return null;

	if (question == null)
		return null;

	for (InvestigationQuestionAnswerVo investigationQuestion : questions)
	{
		if (investigationQuestion.getInvestigationQuestionAnswersIsNotNull())
		{
			for (GeneralQuestionAnswerVo answer : investigationQuestion.getInvestigationQuestionAnswers())
			{
				if (question.equals(answer.getQuestion()))
					return answer.getPatientAnswers();
			}
		}
	}

	return null;
}
 
Example 39
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentDataVo copyAssessmentDataFromPreviousAssessment(PatientAssessmentVo voLastPatientAssessment)
{
	if (voLastPatientAssessment == null || voLastPatientAssessment.getAssessmentData() == null)
		return null;
	PatientAssessmentDataVo voPatientAssessmentData = (PatientAssessmentDataVo) voLastPatientAssessment.getAssessmentData().clone();
	//Clear the ids
	if(voPatientAssessmentData != null)
	{
		voPatientAssessmentData.setID_PatientAssessmentData(null);
		for (int i = 0; voPatientAssessmentData.getAnswerGroupsIsNotNull() && i < voPatientAssessmentData.getAnswerGroups().size(); i++)
		{
			PatientAssessmentGroupVo voPatientAssessmentGroup = voPatientAssessmentData.getAnswerGroups().get(i);
			voPatientAssessmentGroup.setID_PatientAssessmentGroup(null);
			for (int j = 0; voPatientAssessmentGroup.getAssessmentAnswers() != null && j < voPatientAssessmentGroup.getAssessmentAnswers().size(); j++)
			{
				PatientAssessmentQuestionVo voPatientAssessmentQuestion = voPatientAssessmentGroup.getAssessmentAnswers().get(j);
				voPatientAssessmentQuestion.setID_PatientAssessmentQuestion(null);
				voPatientAssessmentQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());
				voPatientAssessmentQuestion.setIsPoc(null);
				voPatientAssessmentQuestion.setIsConfirmed(null);
				voPatientAssessmentQuestion.setIsRoleReadOnly(null);
			}
		}
	}

	return voPatientAssessmentData;
}