Java Code Examples for ims.core.vo.GeneralQuestionAnswerVo

The following are top voted examples for showing how to use ims.core.vo.GeneralQuestionAnswerVo. 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 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 2
Project: AvoinApotti   File: Logic.java   Source Code and License 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 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean itemIdIsInRefusedList(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null || generalQuestionAnswerVo.getItemId() == null)
		return false;
	
	InvestigationRefVoCollection refusedInv = form.getGlobalContext().OCRR.getRefusedInvestigation();
	
	if(refusedInv == null || refusedInv.size() == 0)
		return false;
	
	for(InvestigationRefVo inv : refusedInv)
	{
		if(inv == null)
			continue;
			
		if(inv.getID_Investigation().equals(generalQuestionAnswerVo.getItemId()) || inv.getID_Investigation().equals(generalQuestionAnswerVo.getParentid()))
			return true;
	}
	
	return false;
}
 
Example 4
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow createOrFindInvestigationRow(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null)
		return null;
	
	DynamicGridRow row = null;
	
	for(int i=0; i<gridQuestions.getRows().size(); i++)
	{
		row = gridQuestions.getRows().get(i);
		
		if(row != null && row.getValue() != null && row.getValue().equals(generalQuestionAnswerVo.getItemId()))
			return row;
	}
	
	row = gridQuestions.getRows().newRow();
	
	row.setSelectable(false);
	DynamicGridCell cell = row.getCells().newCell(columnName, DynamicCellType.LABEL);
	row.setBackColor(Color.Beige);
	cell.setValue("Investigation " + this.questionOrInformation + " : " + generalQuestionAnswerVo.getItemName());
	row.setExpanded(true);
	row.setValue(generalQuestionAnswerVo.getItemId());
	
	return row;
}
 
Example 5
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean isClinicalQuestionAlreadyAdded(GeneralQuestionAnswerVo generalQuestionAnswerVo, CategoryQuestionAnswerVoCollection categoryQuestionAnswerVoCollection)
{
	if(categoryQuestionAnswerVoCollection != null)
	{
		for(CategoryQuestionAnswerVo voCatQuestionAnswer : categoryQuestionAnswerVoCollection)
		{
			if(voCatQuestionAnswer.getCategoryQuestionAnswersIsNotNull())
			{
				for(GeneralQuestionAnswerVo voGenQuestAns : voCatQuestionAnswer.getCategoryQuestionAnswers())
				{
					if(voGenQuestAns.getQuestion().equals(generalQuestionAnswerVo.getQuestion()))
						return true;
				}
			}
		}
	}
	
	return false;
}
 
Example 6
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private ServiceQuestionAnswerVo createDummyServiceQuaetionAnswerVo(InvestigationOcsQuestionsVo voInvOcs)
{
	ServiceQuestionAnswerVo voServiceQuestionAnswer = new ServiceQuestionAnswerVo();
	voServiceQuestionAnswer.setService(new ServiceLiteVo());
	voServiceQuestionAnswer.getService().setServiceName("No Service");
	voServiceQuestionAnswer.getService().setServiceCategory(ServiceCategory.CLINICAL);
	
	voServiceQuestionAnswer.setInvestigationQuestionAnswers(new InvestigationQuestionAnswerVoCollection());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().add(new InvestigationQuestionAnswerVo());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigationQuestionAnswers(new GeneralQuestionAnswerVoCollection());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigation(voInvOcs);
	
	
	GeneralQuestionAnswerVoCollection voGQAColl = getInvestigationQuestions(voInvOcs);
	for( GeneralQuestionAnswerVo voItem : voGQAColl)
		voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).getInvestigationQuestionAnswers().add(voItem);
	
	return voServiceQuestionAnswer;
	
}
 
Example 7
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVoCollection getServiceQuestions(ServiceQuestionShortVoCollection serviceConfigQuestions, ServiceLiteVo voServiceLite)
{
	GeneralQuestionAnswerVoCollection serviceQuestions = new GeneralQuestionAnswerVoCollection();
	for (int i = 0; serviceConfigQuestions != null && i < serviceConfigQuestions.size(); i++)
	{
		ServiceQuestionShortVo serviceQuestionShortVo = serviceConfigQuestions.get(i);
		boolean askedForEveryInvestigation = serviceQuestionShortVo.getAskForInvestigationsIsNotNull() && serviceQuestionShortVo.getAskForInvestigations().booleanValue();
		if(askedForEveryInvestigation == false && serviceQuestionShortVo.getService().equals(voServiceLite))
		{
			GeneralQuestionAnswerVo voGQA = createNewServiceQuestion(serviceQuestionShortVo);
			if(voGQA != null)
				serviceQuestions.add(voGQA);
		}
	}
	return serviceQuestions;
}
 
Example 8
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVoCollection getInvestigationQuestions(InvestigationOcsQuestionsVo voInvOcs)
{
	if(voInvOcs == null)
		return null;
	
	GeneralQuestionAnswerVoCollection invQuestions = new GeneralQuestionAnswerVoCollection();
	for (int i = 0; i < voInvOcs.getAssocQuestions().size(); i++)
	{
		InvestigationQuestionShortVo voInvestigationQuestion = voInvOcs.getAssocQuestions().get(i);
		if(isQuestionRelevant(voInvestigationQuestion.getQuestion(), getAge(), getSex()))
		{
			GeneralQuestionAnswerVo voGeneralQuestionAnswer = new GeneralQuestionAnswerVo();
			voGeneralQuestionAnswer.setQuestion(voInvestigationQuestion.getQuestion());
			voGeneralQuestionAnswer.setWasMandatory(voInvestigationQuestion.getIsMandatory());
			invQuestions.add(voGeneralQuestionAnswer);
		}
	}
	
	return invQuestions;
}
 
Example 9
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVo getQuestionAnswer(DynamicGridRow gridRow)
{
	if(gridRow == null)
		return null;
	
	if(gridRow.getIdentifier() instanceof GeneralQuestionAnswerVo)
	{
		GeneralQuestionAnswerVo vo = new GeneralQuestionAnswerVo();
		vo.setQuestion(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getQuestion());
		vo.setWasMandatory(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getWasMandatory());
		vo.setPatientAnswers(getPatientAnswers(gridRow));
		
		return vo;
	}
	
	return null;
}
 
Example 10
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswers(DynamicGridRow row, GeneralQuestionAnswerVo vo)  throws PresentationLogicException
{
	if(vo == null || vo.getQuestion() == null)
		return;
	
	if(vo.getQuestion().getAnswerTypesIsNotNull())
	{
		for(int x = 0; x < vo.getQuestion().getAnswerTypes().size(); x++)
		{
			if(vo.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() 
					&& vo.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue())
			{
				boolean readOnlyCell = false;
				addAnswerCell(row, getAnswerColumn(x), vo.getQuestion().getAnswerTypes().get(x), getInstAnswerType(vo.getPatientAnswers(), vo.getQuestion().getAnswerTypes().get(x)), readOnlyCell);														
			}
		}
	}		
}
 
Example 11
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswerData(DynamicGridRow row,  GeneralQuestionAnswerVo voQuestionAnswer)
{
	if(voQuestionAnswer.getPatientAnswers() == null)
		return;
	
	for(int x = 0; x < voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().size(); x++)
	{
		AnswerDetailsVo answer = voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().get(x);
		DynamicGridCell cell = findCell(row, answer.getAnswerType());
		
		if(cell != null)
		{
			setCellAnswer(cell, answer);
		}
	}
}
 
Example 12
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean hasMandatoryAnswers(GeneralQuestionAnswerVo voGQA)
{
	if(voGQA == null)
		return false;
	
	for (int j = 0; j < voGQA.getPatientAnswers().size(); j++)
	{
		PatientAssessmentAnswerVo voPAA = voGQA.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 13
Project: openMAXIMS   File: Logic.java   Source Code and License 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 14
Project: openMAXIMS   File: Logic.java   Source Code and License 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 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean itemIdIsInRefusedList(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null || generalQuestionAnswerVo.getItemId() == null)
		return false;
	
	InvestigationRefVoCollection refusedInv = form.getGlobalContext().OCRR.getRefusedInvestigation();
	
	if(refusedInv == null || refusedInv.size() == 0)
		return false;
	
	for(InvestigationRefVo inv : refusedInv)
	{
		if(inv == null)
			continue;
			
		if(inv.getID_Investigation().equals(generalQuestionAnswerVo.getItemId()) || inv.getID_Investigation().equals(generalQuestionAnswerVo.getParentid()))
			return true;
	}
	
	return false;
}
 
Example 16
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow createOrFindInvestigationRow(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null)
		return null;
	
	DynamicGridRow row = null;
	
	for(int i=0; i<gridQuestions.getRows().size(); i++)
	{
		row = gridQuestions.getRows().get(i);
		
		if(row != null && row.getValue() != null && row.getValue().equals(generalQuestionAnswerVo.getItemId()))
			return row;
	}
	
	row = gridQuestions.getRows().newRow();
	
	row.setSelectable(false);
	DynamicGridCell cell = row.getCells().newCell(columnName, DynamicCellType.LABEL);
	row.setBackColor(Color.Beige);
	cell.setValue("Investigation " + this.questionOrInformation + " : " + generalQuestionAnswerVo.getItemName());
	row.setExpanded(true);
	row.setValue(generalQuestionAnswerVo.getItemId());
	
	return row;
}
 
Example 17
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean isClinicalQuestionAlreadyAdded(GeneralQuestionAnswerVo generalQuestionAnswerVo, CategoryQuestionAnswerVoCollection categoryQuestionAnswerVoCollection)
{
	if(categoryQuestionAnswerVoCollection != null)
	{
		for(CategoryQuestionAnswerVo voCatQuestionAnswer : categoryQuestionAnswerVoCollection)
		{
			if(voCatQuestionAnswer.getCategoryQuestionAnswersIsNotNull())
			{
				for(GeneralQuestionAnswerVo voGenQuestAns : voCatQuestionAnswer.getCategoryQuestionAnswers())
				{
					if(voGenQuestAns.getQuestion().equals(generalQuestionAnswerVo.getQuestion()))
						return true;
				}
			}
		}
	}
	
	return false;
}
 
Example 18
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private ServiceQuestionAnswerVo createDummyServiceQuaetionAnswerVo(InvestigationOcsQuestionsVo voInvOcs)
{
	ServiceQuestionAnswerVo voServiceQuestionAnswer = new ServiceQuestionAnswerVo();
	voServiceQuestionAnswer.setService(new ServiceLiteVo());
	voServiceQuestionAnswer.getService().setServiceName("No Service");
	voServiceQuestionAnswer.getService().setServiceCategory(ServiceCategory.CLINICAL);
	
	voServiceQuestionAnswer.setInvestigationQuestionAnswers(new InvestigationQuestionAnswerVoCollection());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().add(new InvestigationQuestionAnswerVo());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigationQuestionAnswers(new GeneralQuestionAnswerVoCollection());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigation(voInvOcs);
	
	
	GeneralQuestionAnswerVoCollection voGQAColl = getInvestigationQuestions(voInvOcs);
	for( GeneralQuestionAnswerVo voItem : voGQAColl)
		voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).getInvestigationQuestionAnswers().add(voItem);
	
	return voServiceQuestionAnswer;
	
}
 
Example 19
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVoCollection getServiceQuestions(ServiceQuestionShortVoCollection serviceConfigQuestions, ServiceLiteVo voServiceLite)
{
	GeneralQuestionAnswerVoCollection serviceQuestions = new GeneralQuestionAnswerVoCollection();
	for (int i = 0; serviceConfigQuestions != null && i < serviceConfigQuestions.size(); i++)
	{
		ServiceQuestionShortVo serviceQuestionShortVo = serviceConfigQuestions.get(i);
		boolean askedForEveryInvestigation = serviceQuestionShortVo.getAskForInvestigationsIsNotNull() && serviceQuestionShortVo.getAskForInvestigations().booleanValue();
		if(askedForEveryInvestigation == false && serviceQuestionShortVo.getService().equals(voServiceLite))
		{
			GeneralQuestionAnswerVo voGQA = createNewServiceQuestion(serviceQuestionShortVo);
			if(voGQA != null)
				serviceQuestions.add(voGQA);
		}
	}
	return serviceQuestions;
}
 
Example 20
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVoCollection getInvestigationQuestions(InvestigationOcsQuestionsVo voInvOcs)
{
	if(voInvOcs == null)
		return null;
	
	GeneralQuestionAnswerVoCollection invQuestions = new GeneralQuestionAnswerVoCollection();
	for (int i = 0; i < voInvOcs.getAssocQuestions().size(); i++)
	{
		InvestigationQuestionShortVo voInvestigationQuestion = voInvOcs.getAssocQuestions().get(i);
		if(isQuestionRelevant(voInvestigationQuestion.getQuestion(), getAge(), getSex()))
		{
			GeneralQuestionAnswerVo voGeneralQuestionAnswer = new GeneralQuestionAnswerVo();
			voGeneralQuestionAnswer.setQuestion(voInvestigationQuestion.getQuestion());
			voGeneralQuestionAnswer.setWasMandatory(voInvestigationQuestion.getIsMandatory());
			invQuestions.add(voGeneralQuestionAnswer);
		}
	}
	
	return invQuestions;
}
 
Example 21
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVo getQuestionAnswer(DynamicGridRow gridRow)
{
	if(gridRow == null)
		return null;
	
	if(gridRow.getIdentifier() instanceof GeneralQuestionAnswerVo)
	{
		GeneralQuestionAnswerVo vo = new GeneralQuestionAnswerVo();
		vo.setQuestion(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getQuestion());
		vo.setWasMandatory(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getWasMandatory());
		vo.setPatientAnswers(getPatientAnswers(gridRow));
		
		return vo;
	}
	
	return null;
}
 
Example 22
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswers(DynamicGridRow row, GeneralQuestionAnswerVo vo)  throws PresentationLogicException
{
	if(vo == null || vo.getQuestion() == null)
		return;
	
	if(vo.getQuestion().getAnswerTypesIsNotNull())
	{
		for(int x = 0; x < vo.getQuestion().getAnswerTypes().size(); x++)
		{
			if(vo.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() 
					&& vo.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue())
			{
				boolean readOnlyCell = false;
				addAnswerCell(row, getAnswerColumn(x), vo.getQuestion().getAnswerTypes().get(x), getInstAnswerType(vo.getPatientAnswers(), vo.getQuestion().getAnswerTypes().get(x)), readOnlyCell);														
			}
		}
	}		
}
 
Example 23
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswerData(DynamicGridRow row,  GeneralQuestionAnswerVo voQuestionAnswer)
{
	if(voQuestionAnswer.getPatientAnswers() == null)
		return;
	
	for(int x = 0; x < voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().size(); x++)
	{
		AnswerDetailsVo answer = voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().get(x);
		DynamicGridCell cell = findCell(row, answer.getAnswerType());
		
		if(cell != null)
		{
			setCellAnswer(cell, answer);
		}
	}
}
 
Example 24
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean hasMandatoryAnswers(GeneralQuestionAnswerVo voGQA)
{
	if(voGQA == null)
		return false;
	
	for (int j = 0; j < voGQA.getPatientAnswers().size(); j++)
	{
		PatientAssessmentAnswerVo voPAA = voGQA.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 25
Project: openMAXIMS   File: Logic.java   Source Code and License 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 26
Project: openMAXIMS   File: Logic.java   Source Code and License 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 27
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean itemIdIsInRefusedList(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null || generalQuestionAnswerVo.getItemId() == null)
		return false;
	
	InvestigationRefVoCollection refusedInv = form.getGlobalContext().OCRR.getRefusedInvestigation();
	
	if(refusedInv == null || refusedInv.size() == 0)
		return false;
	
	for(InvestigationRefVo inv : refusedInv)
	{
		if(inv == null)
			continue;
			
		if(inv.getID_Investigation().equals(generalQuestionAnswerVo.getItemId()) || inv.getID_Investigation().equals(generalQuestionAnswerVo.getParentid()))
			return true;
	}
	
	return false;
}
 
Example 28
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow createOrFindInvestigationRow(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null)
		return null;
	
	DynamicGridRow row = null;
	
	for(int i=0; i<gridQuestions.getRows().size(); i++)
	{
		row = gridQuestions.getRows().get(i);
		
		if(row != null && row.getValue() != null && row.getValue().equals(generalQuestionAnswerVo.getItemId()))
			return row;
	}
	
	row = gridQuestions.getRows().newRow();
	
	row.setSelectable(false);
	DynamicGridCell cell = row.getCells().newCell(columnName, DynamicCellType.LABEL);
	row.setBackColor(Color.Beige);
	cell.setValue("Investigation " + this.questionOrInformation + " : " + generalQuestionAnswerVo.getItemName());
	row.setExpanded(true);
	row.setValue(generalQuestionAnswerVo.getItemId());
	
	return row;
}
 
Example 29
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean isClinicalQuestionAlreadyAdded(GeneralQuestionAnswerVo generalQuestionAnswerVo, CategoryQuestionAnswerVoCollection categoryQuestionAnswerVoCollection)
{
	if(categoryQuestionAnswerVoCollection != null)
	{
		for(CategoryQuestionAnswerVo voCatQuestionAnswer : categoryQuestionAnswerVoCollection)
		{
			if(voCatQuestionAnswer.getCategoryQuestionAnswersIsNotNull())
			{
				for(GeneralQuestionAnswerVo voGenQuestAns : voCatQuestionAnswer.getCategoryQuestionAnswers())
				{
					if(voGenQuestAns.getQuestion().equals(generalQuestionAnswerVo.getQuestion()))
						return true;
				}
			}
		}
	}
	
	return false;
}
 
Example 30
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private ServiceQuestionAnswerVo createDummyServiceQuaetionAnswerVo(InvestigationOcsQuestionsVo voInvOcs)
{
	ServiceQuestionAnswerVo voServiceQuestionAnswer = new ServiceQuestionAnswerVo();
	voServiceQuestionAnswer.setService(new ServiceLiteVo());
	voServiceQuestionAnswer.getService().setServiceName("No Service");
	voServiceQuestionAnswer.getService().setServiceCategory(ServiceCategory.CLINICAL);
	
	voServiceQuestionAnswer.setInvestigationQuestionAnswers(new InvestigationQuestionAnswerVoCollection());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().add(new InvestigationQuestionAnswerVo());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigationQuestionAnswers(new GeneralQuestionAnswerVoCollection());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigation(voInvOcs);
	
	
	GeneralQuestionAnswerVoCollection voGQAColl = getInvestigationQuestions(voInvOcs);
	for( GeneralQuestionAnswerVo voItem : voGQAColl)
		voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).getInvestigationQuestionAnswers().add(voItem);
	
	return voServiceQuestionAnswer;
	
}
 
Example 31
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVoCollection getServiceQuestions(ServiceQuestionShortVoCollection serviceConfigQuestions, ServiceLiteVo voServiceLite)
{
	GeneralQuestionAnswerVoCollection serviceQuestions = new GeneralQuestionAnswerVoCollection();
	for (int i = 0; serviceConfigQuestions != null && i < serviceConfigQuestions.size(); i++)
	{
		ServiceQuestionShortVo serviceQuestionShortVo = serviceConfigQuestions.get(i);
		boolean askedForEveryInvestigation = serviceQuestionShortVo.getAskForInvestigationsIsNotNull() && serviceQuestionShortVo.getAskForInvestigations().booleanValue();
		if(askedForEveryInvestigation == false && serviceQuestionShortVo.getService().equals(voServiceLite))
		{
			GeneralQuestionAnswerVo voGQA = createNewServiceQuestion(serviceQuestionShortVo);
			if(voGQA != null)
				serviceQuestions.add(voGQA);
		}
	}
	return serviceQuestions;
}
 
Example 32
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVoCollection getInvestigationQuestions(InvestigationOcsQuestionsVo voInvOcs)
{
	if(voInvOcs == null)
		return null;
	
	GeneralQuestionAnswerVoCollection invQuestions = new GeneralQuestionAnswerVoCollection();
	for (int i = 0; i < voInvOcs.getAssocQuestions().size(); i++)
	{
		InvestigationQuestionShortVo voInvestigationQuestion = voInvOcs.getAssocQuestions().get(i);
		if(isQuestionRelevant(voInvestigationQuestion.getQuestion(), getAge(), getSex()))
		{
			GeneralQuestionAnswerVo voGeneralQuestionAnswer = new GeneralQuestionAnswerVo();
			voGeneralQuestionAnswer.setQuestion(voInvestigationQuestion.getQuestion());
			voGeneralQuestionAnswer.setWasMandatory(voInvestigationQuestion.getIsMandatory());
			invQuestions.add(voGeneralQuestionAnswer);
		}
	}
	
	return invQuestions;
}
 
Example 33
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVo getQuestionAnswer(DynamicGridRow gridRow)
{
	if(gridRow == null)
		return null;
	
	if(gridRow.getIdentifier() instanceof GeneralQuestionAnswerVo)
	{
		GeneralQuestionAnswerVo vo = new GeneralQuestionAnswerVo();
		vo.setQuestion(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getQuestion());
		vo.setWasMandatory(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getWasMandatory());
		vo.setPatientAnswers(getPatientAnswers(gridRow));
		
		return vo;
	}
	
	return null;
}
 
Example 34
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswers(DynamicGridRow row, GeneralQuestionAnswerVo vo)  throws PresentationLogicException
{
	if(vo == null || vo.getQuestion() == null)
		return;
	
	if(vo.getQuestion().getAnswerTypesIsNotNull())
	{
		for(int x = 0; x < vo.getQuestion().getAnswerTypes().size(); x++)
		{
			if(vo.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() 
					&& vo.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue())
			{
				boolean readOnlyCell = false;
				addAnswerCell(row, getAnswerColumn(x), vo.getQuestion().getAnswerTypes().get(x), getInstAnswerType(vo.getPatientAnswers(), vo.getQuestion().getAnswerTypes().get(x)), readOnlyCell);														
			}
		}
	}		
}
 
Example 35
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswerData(DynamicGridRow row,  GeneralQuestionAnswerVo voQuestionAnswer)
{
	if(voQuestionAnswer.getPatientAnswers() == null)
		return;
	
	for(int x = 0; x < voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().size(); x++)
	{
		AnswerDetailsVo answer = voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().get(x);
		DynamicGridCell cell = findCell(row, answer.getAnswerType());
		
		if(cell != null)
		{
			setCellAnswer(cell, answer);
		}
	}
}
 
Example 36
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean hasMandatoryAnswers(GeneralQuestionAnswerVo voGQA)
{
	if(voGQA == null)
		return false;
	
	for (int j = 0; j < voGQA.getPatientAnswers().size(); j++)
	{
		PatientAssessmentAnswerVo voPAA = voGQA.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 37
Project: openmaxims-linux   File: Logic.java   Source Code and License 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   Source Code and License 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: Logic.java   Source Code and License 6 votes vote down vote up
private boolean itemIdIsInRefusedList(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null || generalQuestionAnswerVo.getItemId() == null)
		return false;
	
	InvestigationRefVoCollection refusedInv = form.getGlobalContext().OCRR.getRefusedInvestigation();
	
	if(refusedInv == null || refusedInv.size() == 0)
		return false;
	
	for(InvestigationRefVo inv : refusedInv)
	{
		if(inv == null)
			continue;
			
		if(inv.getID_Investigation().equals(generalQuestionAnswerVo.getItemId()) || inv.getID_Investigation().equals(generalQuestionAnswerVo.getParentid()))
			return true;
	}
	
	return false;
}
 
Example 40
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow createOrFindInvestigationRow(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null)
		return null;
	
	DynamicGridRow row = null;
	
	for(int i=0; i<gridQuestions.getRows().size(); i++)
	{
		row = gridQuestions.getRows().get(i);
		
		if(row != null && row.getValue() != null && row.getValue().equals(generalQuestionAnswerVo.getItemId()))
			return row;
	}
	
	row = gridQuestions.getRows().newRow();
	
	row.setSelectable(false);
	DynamicGridCell cell = row.getCells().newCell(columnName, DynamicCellType.LABEL);
	row.setBackColor(Color.Beige);
	cell.setValue("Investigation " + this.questionOrInformation + " : " + generalQuestionAnswerVo.getItemName());
	row.setExpanded(true);
	row.setValue(generalQuestionAnswerVo.getItemId());
	
	return row;
}
 
Example 41
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean isClinicalQuestionAlreadyAdded(GeneralQuestionAnswerVo generalQuestionAnswerVo, CategoryQuestionAnswerVoCollection categoryQuestionAnswerVoCollection)
{
	if(categoryQuestionAnswerVoCollection != null)
	{
		for(CategoryQuestionAnswerVo voCatQuestionAnswer : categoryQuestionAnswerVoCollection)
		{
			if(voCatQuestionAnswer.getCategoryQuestionAnswersIsNotNull())
			{
				for(GeneralQuestionAnswerVo voGenQuestAns : voCatQuestionAnswer.getCategoryQuestionAnswers())
				{
					if(voGenQuestAns.getQuestion().equals(generalQuestionAnswerVo.getQuestion()))
						return true;
				}
			}
		}
	}
	
	return false;
}
 
Example 42
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private ServiceQuestionAnswerVo createDummyServiceQuaetionAnswerVo(InvestigationOcsQuestionsVo voInvOcs)
{
	ServiceQuestionAnswerVo voServiceQuestionAnswer = new ServiceQuestionAnswerVo();
	voServiceQuestionAnswer.setService(new ServiceLiteVo());
	voServiceQuestionAnswer.getService().setServiceName("No Service");
	voServiceQuestionAnswer.getService().setServiceCategory(ServiceCategory.CLINICAL);
	
	voServiceQuestionAnswer.setInvestigationQuestionAnswers(new InvestigationQuestionAnswerVoCollection());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().add(new InvestigationQuestionAnswerVo());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigationQuestionAnswers(new GeneralQuestionAnswerVoCollection());
	voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).setInvestigation(voInvOcs);
	
	
	GeneralQuestionAnswerVoCollection voGQAColl = getInvestigationQuestions(voInvOcs);
	for( GeneralQuestionAnswerVo voItem : voGQAColl)
		voServiceQuestionAnswer.getInvestigationQuestionAnswers().get(0).getInvestigationQuestionAnswers().add(voItem);
	
	return voServiceQuestionAnswer;
	
}
 
Example 43
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVoCollection getServiceQuestions(ServiceQuestionShortVoCollection serviceConfigQuestions, ServiceLiteVo voServiceLite)
{
	GeneralQuestionAnswerVoCollection serviceQuestions = new GeneralQuestionAnswerVoCollection();
	for (int i = 0; serviceConfigQuestions != null && i < serviceConfigQuestions.size(); i++)
	{
		ServiceQuestionShortVo serviceQuestionShortVo = serviceConfigQuestions.get(i);
		boolean askedForEveryInvestigation = serviceQuestionShortVo.getAskForInvestigationsIsNotNull() && serviceQuestionShortVo.getAskForInvestigations().booleanValue();
		if(askedForEveryInvestigation == false && serviceQuestionShortVo.getService().equals(voServiceLite))
		{
			GeneralQuestionAnswerVo voGQA = createNewServiceQuestion(serviceQuestionShortVo);
			if(voGQA != null)
				serviceQuestions.add(voGQA);
		}
	}
	return serviceQuestions;
}
 
Example 44
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVoCollection getInvestigationQuestions(InvestigationOcsQuestionsVo voInvOcs)
{
	if(voInvOcs == null)
		return null;
	
	GeneralQuestionAnswerVoCollection invQuestions = new GeneralQuestionAnswerVoCollection();
	for (int i = 0; i < voInvOcs.getAssocQuestions().size(); i++)
	{
		InvestigationQuestionShortVo voInvestigationQuestion = voInvOcs.getAssocQuestions().get(i);
		if(isQuestionRelevant(voInvestigationQuestion.getQuestion(), getAge(), getSex()))
		{
			GeneralQuestionAnswerVo voGeneralQuestionAnswer = new GeneralQuestionAnswerVo();
			voGeneralQuestionAnswer.setQuestion(voInvestigationQuestion.getQuestion());
			voGeneralQuestionAnswer.setWasMandatory(voInvestigationQuestion.getIsMandatory());
			invQuestions.add(voGeneralQuestionAnswer);
		}
	}
	
	return invQuestions;
}
 
Example 45
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private GeneralQuestionAnswerVo getQuestionAnswer(DynamicGridRow gridRow)
{
	if(gridRow == null)
		return null;
	
	if(gridRow.getIdentifier() instanceof GeneralQuestionAnswerVo)
	{
		GeneralQuestionAnswerVo vo = new GeneralQuestionAnswerVo();
		vo.setQuestion(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getQuestion());
		vo.setWasMandatory(((GeneralQuestionAnswerVo)gridRow.getIdentifier()).getWasMandatory());
		vo.setPatientAnswers(getPatientAnswers(gridRow));
		
		return vo;
	}
	
	return null;
}
 
Example 46
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswers(DynamicGridRow row, GeneralQuestionAnswerVo vo)  throws PresentationLogicException
{
	if(vo == null || vo.getQuestion() == null)
		return;
	
	if(vo.getQuestion().getAnswerTypesIsNotNull())
	{
		for(int x = 0; x < vo.getQuestion().getAnswerTypes().size(); x++)
		{
			if(vo.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() 
					&& vo.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue())
			{
				boolean readOnlyCell = false;
				addAnswerCell(row, getAnswerColumn(x), vo.getQuestion().getAnswerTypes().get(x), getInstAnswerType(vo.getPatientAnswers(), vo.getQuestion().getAnswerTypes().get(x)), readOnlyCell);														
			}
		}
	}		
}
 
Example 47
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswerData(DynamicGridRow row,  GeneralQuestionAnswerVo voQuestionAnswer)
{
	if(voQuestionAnswer.getPatientAnswers() == null)
		return;
	
	for(int x = 0; x < voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().size(); x++)
	{
		AnswerDetailsVo answer = voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().get(x);
		DynamicGridCell cell = findCell(row, answer.getAnswerType());
		
		if(cell != null)
		{
			setCellAnswer(cell, answer);
		}
	}
}
 
Example 48
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private boolean hasMandatoryAnswers(GeneralQuestionAnswerVo voGQA)
{
	if(voGQA == null)
		return false;
	
	for (int j = 0; j < voGQA.getPatientAnswers().size(); j++)
	{
		PatientAssessmentAnswerVo voPAA = voGQA.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 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void amendAsnwers(GeneralQuestionAnswerVo generalQuestion, PatientAssessmentAnswerVoCollection patientAnswer)
{
	if (generalQuestion == null)
		return;
	
	if (patientAnswer != null)
	{
		if (generalQuestion.getPatientAnswers() == null)
			generalQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());

		for (PatientAssessmentAnswerVo originalAnswer : patientAnswer)
		{
			PatientAssessmentAnswerVo answer = (PatientAssessmentAnswerVo) originalAnswer.clone();

			answer.setID_PatientAssessmentAnswer(null);
			answer.setAuthoringInfo(null);
			answer.setConfirmingInfo(null);

			if (answer.getAnswerDetailsIsNotNull())
			{
				for (AnswerDetailsVo answerDetails : answer.getAnswerDetails())
				{
					answerDetails.setID_PatientAnswerDetails(null);
				}
			}

			generalQuestion.getPatientAnswers().add(answer);
		}
	}
}
 
Example 50
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private boolean isQuestionAdded(GeneralQuestionAnswerVo vo, GeneralQuestionAnswerVoCollection serviceQuestionAnswers)
{
	if(serviceQuestionAnswers == null)
		return false;
	
	for (int i = 0; i < serviceQuestionAnswers.size(); i++)
	{
		if(serviceQuestionAnswers.get(i).getQuestion().equals(vo.getQuestion()))
			return true;
	}
	
	return false;
}
 
Example 51
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private GeneralQuestionAnswerVo createNewCategoryQuestion(CategoryQuestionShortVo categoryConfigQuestion)
{
	if(categoryConfigQuestion == null)
		return null;
	
	if(isQuestionRelevant(categoryConfigQuestion.getQuestionInformation(), getAge(), getSex()) == false)
		return null;
	
	GeneralQuestionAnswerVo categoryQuestion = new GeneralQuestionAnswerVo();
	categoryQuestion.setQuestion(categoryConfigQuestion.getQuestionInformation());
	categoryQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());
	categoryQuestion.setWasMandatory(categoryConfigQuestion.getIsMandatory());
	return categoryQuestion;
}
 
Example 52
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private GeneralQuestionAnswerVo createNewServiceQuestion(ServiceQuestionShortVo serviceQuestionConfig)
{
	if(serviceQuestionConfig == null)
		return null;
	
	if(isQuestionRelevant(serviceQuestionConfig.getQuestionInformation(), getAge(), getSex()) == false)
		return null;
	
	GeneralQuestionAnswerVo serviceQuestion = new GeneralQuestionAnswerVo();
	serviceQuestion.setQuestion(serviceQuestionConfig.getQuestionInformation());
	serviceQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());
	serviceQuestion.setWasMandatory(serviceQuestionConfig.getIsMandatory());
	return serviceQuestion;
}
 
Example 53
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private void addQuestion(DynamicGridRow pRow, GeneralQuestionAnswerVo question, boolean previewMode) throws PresentationLogicException
{
	Image rowQuestionImage = null;
	if(question.getIQuestionTypeQuestion().getIsQuestionIsNotNull() && question.getIQuestionTypeQuestion().getIsQuestion().equals(Boolean.FALSE))
		rowQuestionImage = this.infoImage;
	else
	{
		rowQuestionImage = this.questionImage;
		if(question.getIQuestionTypeIsMandatory() != null && question.getIQuestionTypeIsMandatory().booleanValue())
			rowQuestionImage = this.mandatoryQuestionImage;
	}
	
	DynamicGridRow row = pRow.getRows().newRow();
	row.setSelectable(false);
	
	row.setCollapsedImage(rowQuestionImage);
	row.setExpandedImage(rowQuestionImage);
	
	DynamicGridCell questionNameCell = row.getCells().newCell(this.gridQuestions.getColumns().getByIdentifier(QUESTION_COLUMN), DynamicCellType.WRAPTEXT);
	questionNameCell.setReadOnly(true);
	questionNameCell.setValue(question.getIQuestionTypeQuestion().getText());
	
	row.setIdentifier(question);
	
	if(question.getQuestionIsNotNull() && previewMode == false)
		addAnswers(row, question);
}
 
Example 54
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private boolean addAnswers(DynamicGridRow row, DynamicGridColumn[] columns, GeneralQuestionAnswerVo question)
{
	if(row == null || question == null || question.getIQuestionTypeQuestion() == null ||  question.getIQuestionTypeQuestion().getAnswerTypes() == null  || question.getIQuestionTypeQuestion().getAnswerTypes().size() == 0)
		return false;
		
	for(int x = 0; x < question.getIQuestionTypeQuestion().getAnswerTypes().size(); x++)
	{
		QuestionAnswerTypeVo answer = question.getIQuestionTypeQuestion().getAnswerTypes().get(x);
		if(answer != null)
		{
			QuestionAnswerType type = answer.getAnswerType();
			DynamicCellType cellType = getQuestionAnswerType(type);
			DynamicGridCell answerCell = row.getCells().newCell(columns[x], getQuestionAnswerType(type));
			answerCell.setWidth(getAnswerCellWidth(cellType));
			answerCell.setReadOnly(false);
			
			setAnswerCellValue(answerCell, answer);
			
			if(cellType == DynamicCellType.DYNAMICLABEL || cellType == DynamicCellType.BOOL)
				answerCell.setDecoratorType(DynamicCellDecoratorMode.NEVER);
			else
				answerCell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
			
			answerCell.setTooltip(getAnswerCellTooltip(cellType));
			answerCell.setIdentifier(answer);
			
			addAnswerData(row, question);
		}
	}
	
	return true;		
}
 
Example 55
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private ArrayList<String> getMandatoryAnswers(GeneralQuestionAnswerVo voGQA)
{
	ArrayList<String> errors = null;
	String separator = ", ";

	for (int j = 0; j < voGQA.getPatientAnswers().size(); j++)
	{
		PatientAssessmentAnswerVo voPAA = voGQA.getPatientAnswers().get(j);
		for (int k = 0; k < voPAA.getAnswerDetails().size(); k++)
		{
			// Check if answer is mandatory
			if (voPAA.getAnswerDetails().get(k).getAnswerType().getIsMandatoryIsNotNull() && voPAA.getAnswerDetails().get(k).getAnswerType().getIsMandatory().booleanValue())
			{
				if (isAnswered(voPAA.getAnswerDetails().get(k)) == false)
				{
					if (errors == null)
						errors = new ArrayList<String>();
					
					//Add the mandatory validation message only if not null or size > 0 WDEV-17050
					errors.add(voPAA.getAnswerDetails().get(k).getAnswerType().getMandatoryValMessageIsNotNull() && voPAA.getAnswerDetails().get(k).getAnswerType().getMandatoryValMessage().trim().length() > 0 ? voPAA.getAnswerDetails().get(k).getAnswerType().getMandatoryValMessage() : "");
					errors.add(voPAA.getAnswerDetails().get(k).getAnswerType().getMandatoryValMessageIsNotNull() && voPAA.getAnswerDetails().get(k).getAnswerType().getMandatoryValMessage().trim().length() > 0 ? separator: "" );
				}
			}
		}
	}

	//Remove last separator ", "
	if(errors != null && errors.size() > 0)
		errors.remove(errors.size() - 1);
	
	return errors;
}
 
Example 56
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void amendAsnwers(GeneralQuestionAnswerVo generalQuestion, PatientAssessmentAnswerVoCollection patientAnswer)
{
	if (generalQuestion == null)
		return;
	
	if (patientAnswer != null)
	{
		if (generalQuestion.getPatientAnswers() == null)
			generalQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());

		for (PatientAssessmentAnswerVo originalAnswer : patientAnswer)
		{
			PatientAssessmentAnswerVo answer = (PatientAssessmentAnswerVo) originalAnswer.clone();

			answer.setID_PatientAssessmentAnswer(null);
			answer.setAuthoringInfo(null);
			answer.setConfirmingInfo(null);

			if (answer.getAnswerDetailsIsNotNull())
			{
				for (AnswerDetailsVo answerDetails : answer.getAnswerDetails())
				{
					answerDetails.setID_PatientAnswerDetails(null);
				}
			}

			generalQuestion.getPatientAnswers().add(answer);
		}
	}
}
 
Example 57
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private boolean isQuestionAdded(GeneralQuestionAnswerVo vo, GeneralQuestionAnswerVoCollection serviceQuestionAnswers)
{
	if(serviceQuestionAnswers == null)
		return false;
	
	for (int i = 0; i < serviceQuestionAnswers.size(); i++)
	{
		if(serviceQuestionAnswers.get(i).getQuestion().equals(vo.getQuestion()))
			return true;
	}
	
	return false;
}
 
Example 58
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private GeneralQuestionAnswerVo createNewCategoryQuestion(CategoryQuestionShortVo categoryConfigQuestion)
{
	if(categoryConfigQuestion == null)
		return null;
	
	if(isQuestionRelevant(categoryConfigQuestion.getQuestionInformation(), getAge(), getSex()) == false)
		return null;
	
	GeneralQuestionAnswerVo categoryQuestion = new GeneralQuestionAnswerVo();
	categoryQuestion.setQuestion(categoryConfigQuestion.getQuestionInformation());
	categoryQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());
	categoryQuestion.setWasMandatory(categoryConfigQuestion.getIsMandatory());
	return categoryQuestion;
}
 
Example 59
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private GeneralQuestionAnswerVo createNewServiceQuestion(ServiceQuestionShortVo serviceQuestionConfig)
{
	if(serviceQuestionConfig == null)
		return null;
	
	if(isQuestionRelevant(serviceQuestionConfig.getQuestionInformation(), getAge(), getSex()) == false)
		return null;
	
	GeneralQuestionAnswerVo serviceQuestion = new GeneralQuestionAnswerVo();
	serviceQuestion.setQuestion(serviceQuestionConfig.getQuestionInformation());
	serviceQuestion.setPatientAnswers(new PatientAssessmentAnswerVoCollection());
	serviceQuestion.setWasMandatory(serviceQuestionConfig.getIsMandatory());
	return serviceQuestion;
}
 
Example 60
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private void addQuestion(DynamicGridRow pRow, GeneralQuestionAnswerVo question, boolean previewMode) throws PresentationLogicException
{
	Image rowQuestionImage = null;
	if(question.getIQuestionTypeQuestion().getIsQuestionIsNotNull() && question.getIQuestionTypeQuestion().getIsQuestion().equals(Boolean.FALSE))
		rowQuestionImage = this.infoImage;
	else
	{
		rowQuestionImage = this.questionImage;
		if(question.getIQuestionTypeIsMandatory() != null && question.getIQuestionTypeIsMandatory().booleanValue())
			rowQuestionImage = this.mandatoryQuestionImage;
	}
	
	DynamicGridRow row = pRow.getRows().newRow();
	row.setSelectable(false);
	
	row.setCollapsedImage(rowQuestionImage);
	row.setExpandedImage(rowQuestionImage);
	
	DynamicGridCell questionNameCell = row.getCells().newCell(this.gridQuestions.getColumns().getByIdentifier(QUESTION_COLUMN), DynamicCellType.WRAPTEXT);
	questionNameCell.setReadOnly(true);
	questionNameCell.setValue(question.getIQuestionTypeQuestion().getText());
	
	row.setIdentifier(question);
	
	if(question.getQuestionIsNotNull() && previewMode == false)
		addAnswers(row, question);
}