Java Code Examples for ims.core.vo.QuestionInformationVo

The following are top voted examples for showing how to use ims.core.vo.QuestionInformationVo. 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 void editQuestion() 
{
	Object objQInfo;
	if(isDialog())
		objQInfo = form.lyrTrees().tabPageSelect().grdListedQuestions().getValue();
	else
		objQInfo = form.lyrTrees().tabPageSearch().grdQuestions().getValue();			

	if(objQInfo == null || (objQInfo instanceof QuestionInformationShortVo == false))
	{
		engine.showMessage("Please select a record");
		return;
	}
	form.getGlobalContext().Admin.setIsNewQuestion(new Boolean(false));		
	QuestionInformationVo voSelectedQuestion =  domain.getQuestion(((QuestionInformationShortVo)objQInfo).getID_QuestionInformation());
	form.getGlobalContext().Admin.setSelectedQuestion(voSelectedQuestion);
	engine.open(form.getForms().Core.QuestionAnswer);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void editQuestion(AssessmentQuestionVo assessmentQuestionVo)
{
	if (assessmentQuestionVo == null)
		return;

	QuestionInformationVo voQInfo = assessmentQuestionVo.getQuestion();
	form.getLocalContext().setVoQuestionInformation(voQInfo);

	clearQuestionControls();
	populateControlsFromData(voQInfo);
	form.lyrTabs().tabNewQuestion().lyrDetails().tabGeneral().txtURL().setValue(assessmentQuestionVo.getURL());
	form.lyrTabs().tabNewQuestion().lyrDetails().tabGeneral().txtProtocol().setValue(assessmentQuestionVo.getProtocol());
	form.lyrTabs().tabNewQuestion().lyrDetails().tabLegend().richTextLegend().setValue(assessmentQuestionVo.getLegendText());

	form.setMode(FormMode.EDIT);
	setIsNewQuestion(new Boolean(false));
	enableTabNewQuestion(true);
	enableTabSearchQuestion(false);
	
	showTabNewQuestion();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void editQuestion(QuestionInformationShortVo voQInfoShort)
{
	QuestionInformationVo voQInfo = null;
	if (voQInfoShort != null && voQInfoShort.getID_QuestionInformationIsNotNull())
	{
		voQInfo = domain.getQuestion(voQInfoShort.getID_QuestionInformation());
		form.getLocalContext().setVoQuestionInformation(voQInfo);
	}

	clearQuestionControls();
	populateControlsFromData(voQInfo);

	setIsNewQuestion(new Boolean(false));
	enableTabNewQuestion(true);
	boolean isPrimaryQuestion = voQInfo != null && voQInfo .getQuestionTypeIsNotNull() && voQInfo .getQuestionType().equals(QuestionType.PRIMARY)?true:false;
	if(isDialog())
		enableTabSearchQuestion(false);
	else
	{
		enableTabListQuestion(false);
		showClassificationTree(isPrimaryQuestion);
	}
	
	showTabNewQuestion();
	form.setMode(FormMode.EDIT);
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected QuestionInformationVo populateDataFromScreen(QuestionInformationVo voQInfo)
{
	// Populate the controls that cannot be binded
	IntRange ageRange = form.lyrTabs().tabNewQuestion().lyrDetails().tabGeneral().irbAgeRange().getValue();
	voQInfo.setAgeRangeMax(ageRange != null ? ageRange.getMax() : null);
	voQInfo.setAgeRangeMin(ageRange != null ? ageRange.getMin() : null);
	if(voQInfo.getID_QuestionInformation() == null)
		voQInfo.setQuestionType(form.getGlobalContext().Core.getQuestionType());

	voQInfo.setClassification(getClassification());
	//voQInfo.setKeywords(getKewords());
	
	boolean isClone = voQInfo.getID_QuestionInformationIsNotNull() && voQInfo.getID_QuestionInformation() == -1;
	
	voQInfo.setAnswerTypes(getAnswerTypes(isClone ? null : voQInfo.getAnswerTypes(), isClone));
	voQInfo.setTaxonomyMap(form.lyrTabs().tabNewQuestion().lyrDetails().tabTaxonomy().customTaxonomy().getValue());
	super.populateDataFromScreen(voQInfo);
	voQInfo.setLegendText(form.lyrTabs().tabNewQuestion().lyrDetails().tabLegend().richTextLegend().getValue());
	
	if(isClone)
	{
		voQInfo.setID_QuestionInformation(null);
	}
	
	return voQInfo;		
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateClassification(QuestionInformationVo voQInfo)
{
	if (voQInfo != null && voQInfo.getClassificationIsNotNull())
	{
		QuestionClassification qClassInfo;
		TreeNode node;
		for (int j = 0; j < voQInfo.getClassification().size(); j++)
		{
			qClassInfo = voQInfo.getClassification().get(j);
			for (int i = 0; i < form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().size(); i++)
			{
				node = form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().get(i);
				if (qClassInfo.equals(node.getValue()))
					node.setChecked(true);

				if (node.getNodes() != null && node.getNodes().size() > 0)
					setClassificationValue(qClassInfo, node);
			}
		}
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void loadQuestion() 
{
	form.grdAnswerType().getRows().clear();
	
	QuestionInformationVo voQInfo = form.getGlobalContext().Admin.getSelectedQuestion();
	if(voQInfo != null)
	{
		//Populated binded controls
		super.populateScreenFromData(voQInfo);
		form.cmbStatus().setValue(voQInfo.getStatus());
		loadClassification(voQInfo);
		populateTaxonomy(voQInfo);
		populateAnswerTypes(voQInfo);
		form.irbAgeRange().setValue(new IntRange(voQInfo.getAgeRangeMin(), voQInfo.getAgeRangeMax()));
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void loadClassification(QuestionInformationVo voQInfo) 
{
	if(voQInfo != null && voQInfo.getClassificationIsNotNull())
	{
		QuestionClassification qClassInfo;
		TreeNode node;
		for(int j=0; j<voQInfo.getClassification().size(); j++)
		{
			qClassInfo = voQInfo.getClassification().get(j);
			for(int i=0; i<form.treClassification().getNodes().size(); i++)
			{
				node = form.treClassification().getNodes().get(i);
				if(qClassInfo.equals(node.getValue()))
					node.setChecked(true);

				if(node.getNodes() != null && node.getNodes().size() > 0)
					setClassificationValue(qClassInfo, node);
			}
		}
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 9
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 10
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 11
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 12
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 13
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 14
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 15
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void editQuestion(QuestionInformationShortVo voQInfoShort)
{
	QuestionInformationVo voQInfo = null;
	if (voQInfoShort != null && voQInfoShort.getID_QuestionInformationIsNotNull())
	{
		voQInfo = domain.getQuestion(voQInfoShort.getID_QuestionInformation());
		form.getLocalContext().setVoQuestionInformation(voQInfo);
	}

	clearQuestionControls();
	populateControlsFromData(voQInfo);

	setIsNewQuestion(new Boolean(false));
	enableTabNewQuestion(true);
	boolean isPrimaryQuestion = voQInfo != null && voQInfo .getQuestionTypeIsNotNull() && voQInfo .getQuestionType().equals(QuestionType.PRIMARY)?true:false;
	if(isDialog())
		enableTabSearchQuestion(false);
	else
	{
		enableTabListQuestion(false);
		showClassificationTree(isPrimaryQuestion);
	}
	
	showTabNewQuestion();
	form.setMode(FormMode.EDIT);
}
 
Example 16
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void editQuestion() 
{
	Object objQInfo;
	if(isDialog())
		objQInfo = form.lyrTrees().tabPageSelect().grdListedQuestions().getValue();
	else
		objQInfo = form.lyrTrees().tabPageSearch().grdQuestions().getValue();			

	if(objQInfo == null || (objQInfo instanceof QuestionInformationShortVo == false))
	{
		engine.showMessage("Please select a record");
		return;
	}
	form.getGlobalContext().Admin.setIsNewQuestion(new Boolean(false));		
	QuestionInformationVo voSelectedQuestion =  domain.getQuestion(((QuestionInformationShortVo)objQInfo).getID_QuestionInformation());
	form.getGlobalContext().Admin.setSelectedQuestion(voSelectedQuestion);
	engine.open(form.getForms().Core.QuestionAnswer);
}
 
Example 17
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 18
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void loadQuestion() 
{
	form.grdAnswerType().getRows().clear();
	
	QuestionInformationVo voQInfo = form.getGlobalContext().Admin.getSelectedQuestion();
	if(voQInfo != null)
	{
		//Populated binded controls
		super.populateScreenFromData(voQInfo);
		form.cmbStatus().setValue(voQInfo.getStatus());
		loadClassification(voQInfo);
		populateTaxonomy(voQInfo);
		populateAnswerTypes(voQInfo);
		form.irbAgeRange().setValue(new IntRange(voQInfo.getAgeRangeMin(), voQInfo.getAgeRangeMax()));
	}
}
 
Example 19
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void loadClassification(QuestionInformationVo voQInfo) 
{
	if(voQInfo != null && voQInfo.getClassificationIsNotNull())
	{
		QuestionClassification qClassInfo;
		TreeNode node;
		for(int j=0; j<voQInfo.getClassification().size(); j++)
		{
			qClassInfo = voQInfo.getClassification().get(j);
			for(int i=0; i<form.treClassification().getNodes().size(); i++)
			{
				node = form.treClassification().getNodes().get(i);
				if(qClassInfo.equals(node.getValue()))
					node.setChecked(true);

				if(node.getNodes() != null && node.getNodes().size() > 0)
					setClassificationValue(qClassInfo, node);
			}
		}
	}
}
 
Example 20
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
protected QuestionInformationVo populateDataFromScreen(QuestionInformationVo voQInfo)
{
	// Populate the controls that cannot be binded
	IntRange ageRange = form.lyrTabs().tabNewQuestion().lyrDetails().tabGeneral().irbAgeRange().getValue();
	voQInfo.setAgeRangeMax(ageRange != null ? ageRange.getMax() : null);
	voQInfo.setAgeRangeMin(ageRange != null ? ageRange.getMin() : null);
	if(voQInfo.getID_QuestionInformation() == null)
		voQInfo.setQuestionType(form.getGlobalContext().Core.getQuestionType());

	voQInfo.setClassification(getClassification());
	//voQInfo.setKeywords(getKewords());
	
	boolean isClone = voQInfo.getID_QuestionInformationIsNotNull() && voQInfo.getID_QuestionInformation() == -1;
	
	voQInfo.setAnswerTypes(getAnswerTypes(isClone ? null : voQInfo.getAnswerTypes(), isClone));
	voQInfo.setTaxonomyMap(form.lyrTabs().tabNewQuestion().lyrDetails().tabTaxonomy().customTaxonomy().getValue());
	super.populateDataFromScreen(voQInfo);
	voQInfo.setLegendText(form.lyrTabs().tabNewQuestion().lyrDetails().tabLegend().richTextLegend().getValue());
	
	if(isClone)
	{
		voQInfo.setID_QuestionInformation(null);
	}
	
	return voQInfo;		
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 22
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void populateClassification(QuestionInformationVo voQInfo)
{
	if (voQInfo != null && voQInfo.getClassificationIsNotNull())
	{
		QuestionClassification qClassInfo;
		TreeNode node;
		for (int j = 0; j < voQInfo.getClassification().size(); j++)
		{
			qClassInfo = voQInfo.getClassification().get(j);
			for (int i = 0; i < form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().size(); i++)
			{
				node = form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().get(i);
				if (qClassInfo.equals(node.getValue()))
					node.setChecked(true);

				if (node.getNodes() != null && node.getNodes().size() > 0)
					setClassificationValue(qClassInfo, node);
			}
		}
	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 24
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 25
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 26
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 27
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 28
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 29
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void loadClassification(QuestionInformationVo voQInfo) 
{
	if(voQInfo != null && voQInfo.getClassificationIsNotNull())
	{
		QuestionClassification qClassInfo;
		TreeNode node;
		for(int j=0; j<voQInfo.getClassification().size(); j++)
		{
			qClassInfo = voQInfo.getClassification().get(j);
			for(int i=0; i<form.treClassification().getNodes().size(); i++)
			{
				node = form.treClassification().getNodes().get(i);
				if(qClassInfo.equals(node.getValue()))
					node.setChecked(true);

				if(node.getNodes() != null && node.getNodes().size() > 0)
					setClassificationValue(qClassInfo, node);
			}
		}
	}
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void editQuestion(AssessmentQuestionVo assessmentQuestionVo)
{
	if (assessmentQuestionVo == null)
		return;

	QuestionInformationVo voQInfo = assessmentQuestionVo.getQuestion();
	form.getLocalContext().setVoQuestionInformation(voQInfo);

	clearQuestionControls();
	populateControlsFromData(voQInfo);
	form.lyrTabs().tabNewQuestion().lyrDetails().tabGeneral().txtURL().setValue(assessmentQuestionVo.getURL());
	form.lyrTabs().tabNewQuestion().lyrDetails().tabGeneral().txtProtocol().setValue(assessmentQuestionVo.getProtocol());
	form.lyrTabs().tabNewQuestion().lyrDetails().tabLegend().richTextLegend().setValue(assessmentQuestionVo.getLegendText());

	form.setMode(FormMode.EDIT);
	setIsNewQuestion(new Boolean(false));
	enableTabNewQuestion(true);
	enableTabSearchQuestion(false);
	
	showTabNewQuestion();
}
 
Example 31
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void editQuestion(AssessmentQuestionVo assessmentQuestionVo)
{
	if (assessmentQuestionVo == null)
		return;

	QuestionInformationVo voQInfo = assessmentQuestionVo.getQuestion();
	form.getLocalContext().setVoQuestionInformation(voQInfo);

	clearQuestionControls();
	populateControlsFromData(voQInfo);
	form.lyrTabs().tabNewQuestion().lyrDetails().tabGeneral().txtURL().setValue(assessmentQuestionVo.getURL());
	form.lyrTabs().tabNewQuestion().lyrDetails().tabGeneral().txtProtocol().setValue(assessmentQuestionVo.getProtocol());
	form.lyrTabs().tabNewQuestion().lyrDetails().tabLegend().richTextLegend().setValue(assessmentQuestionVo.getLegendText());

	form.setMode(FormMode.EDIT);
	setIsNewQuestion(new Boolean(false));
	enableTabNewQuestion(true);
	enableTabSearchQuestion(false);
	
	showTabNewQuestion();
}
 
Example 32
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateClassification(QuestionInformationVo voQInfo)
{
	if (voQInfo != null && voQInfo.getClassificationIsNotNull())
	{
		QuestionClassification qClassInfo;
		TreeNode node;
		for (int j = 0; j < voQInfo.getClassification().size(); j++)
		{
			qClassInfo = voQInfo.getClassification().get(j);
			for (int i = 0; i < form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().size(); i++)
			{
				node = form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().get(i);
				if (qClassInfo.equals(node.getValue()))
					node.setChecked(true);

				if (node.getNodes() != null && node.getNodes().size() > 0)
					setClassificationValue(qClassInfo, node);
			}
		}
	}
}
 
Example 33
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void loadQuestion() 
{
	form.grdAnswerType().getRows().clear();
	
	QuestionInformationVo voQInfo = form.getGlobalContext().Admin.getSelectedQuestion();
	if(voQInfo != null)
	{
		//Populated binded controls
		super.populateScreenFromData(voQInfo);
		form.cmbStatus().setValue(voQInfo.getStatus());
		loadClassification(voQInfo);
		populateTaxonomy(voQInfo);
		populateAnswerTypes(voQInfo);
		form.irbAgeRange().setValue(new IntRange(voQInfo.getAgeRangeMin(), voQInfo.getAgeRangeMax()));
	}
}
 
Example 34
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 35
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void loadQuestion() 
{
	form.grdAnswerType().getRows().clear();
	
	QuestionInformationVo voQInfo = form.getGlobalContext().Admin.getSelectedQuestion();
	if(voQInfo != null)
	{
		//Populated binded controls
		super.populateScreenFromData(voQInfo);
		form.cmbStatus().setValue(voQInfo.getStatus());
		loadClassification(voQInfo);
		populateTaxonomy(voQInfo);
		populateAnswerTypes(voQInfo);
		form.irbAgeRange().setValue(new IntRange(voQInfo.getAgeRangeMin(), voQInfo.getAgeRangeMax()));
	}
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void editQuestion(QuestionInformationShortVo voQInfoShort)
{
	QuestionInformationVo voQInfo = null;
	if (voQInfoShort != null && voQInfoShort.getID_QuestionInformationIsNotNull())
	{
		voQInfo = domain.getQuestion(voQInfoShort.getID_QuestionInformation());
		form.getLocalContext().setVoQuestionInformation(voQInfo);
	}

	clearQuestionControls();
	populateControlsFromData(voQInfo);

	setIsNewQuestion(new Boolean(false));
	enableTabNewQuestion(true);
	boolean isPrimaryQuestion = voQInfo != null && voQInfo .getQuestionTypeIsNotNull() && voQInfo .getQuestionType().equals(QuestionType.PRIMARY)?true:false;
	if(isDialog())
		enableTabSearchQuestion(false);
	else
	{
		enableTabListQuestion(false);
		showClassificationTree(isPrimaryQuestion);
	}
	
	showTabNewQuestion();
	form.setMode(FormMode.EDIT);
}
 
Example 37
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 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private grdListedQuestionsRow getChildListNode(QuestionClassification item, QuestionInformationShortVo voQInfo) 
{
	grdListedQuestionsRow parentRow, childRow;
	//Children
	for(int i=0; i<form.lyrTrees().tabPageSelect().grdListedQuestions().getRows().size(); i++)
	{
		parentRow = form.lyrTrees().tabPageSelect().grdListedQuestions().getRows().get(i);
		for(int k=0; parentRow != null && k<parentRow.getRows().size(); k++)
		{
			childRow = parentRow.getRows().get(k);
			Object objValue = childRow.getValue();
			if(objValue instanceof QuestionClassification)
			{
				if(item.equals(objValue))
				{
					//Check for duplicates
					for(int x=0; x<childRow.getRows().size(); x++)
					{
						Object value = childRow.getRows().get(x).getValue();
						if(value instanceof QuestionInformationVo && value.equals(voQInfo))
							return null;
					}
					
					return childRow.getRows().newRow();
				}
			}
		}
	}
	return null;
}
 
Example 39
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private grdSelectedQuestionsRow getChildSelNode(QuestionClassification item, QuestionInformationShortVo voQInfo) 
{
	grdSelectedQuestionsRow parentRow, childRow;
	//Children
	for(int i=0; i<form.lyrTrees().tabPageSelect().grdSelectedQuestions().getRows().size(); i++)
	{
		parentRow = form.lyrTrees().tabPageSelect().grdSelectedQuestions().getRows().get(i);
		for(int k=0; parentRow != null && k<parentRow.getRows().size(); k++)
		{
			childRow = parentRow.getRows().get(k);
			Object objValue = childRow.getValue();
			if(objValue instanceof QuestionClassification)
			{
				if(item.equals(objValue))
				{
					//Check for duplicates
					for(int x=0; x<childRow.getRows().size(); x++)
					{
						Object value = childRow.getRows().get(x).getValue();
						if(value instanceof QuestionInformationVo && value.equals(voQInfo))
							return null;
					}
					
					return childRow.getRows().newRow();
				}
			}
		}
	}
	return null;
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean voAddedToParent(QuestionInformationShortVo voQInfo) 
{
	for(int i=0; i<form.lyrTrees().tabPageSearch().grdQuestions().getRows().size(); i++)
	{
		for(int j=0; j<form.lyrTrees().tabPageSearch().grdQuestions().getRows().get(i).getRows().size(); j++)
		{
			Object objValue = form.lyrTrees().tabPageSearch().grdQuestions().getRows().get(i).getRows().get(j);
			if(objValue instanceof QuestionInformationVo && ((QuestionInformationVo)objValue).equals(voQInfo))
			{
				return true;
			}
		}
	}
	return false;
}