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   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 2
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 3
Project: AvoinApotti   File: Logic.java   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   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 14
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 15
Project: openMAXIMS   File: Logic.java   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   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 26
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 27
Project: openMAXIMS   File: Logic.java   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   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: Logic.java   View source code 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   View source code 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;
}