Java Code Examples for ims.core.vo.QuestionAnswerTypeVo

The following are top voted examples for showing how to use ims.core.vo.QuestionAnswerTypeVo. 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
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
	if (formName.equals(form.getForms().Core.QuestionAnswerType) && result.equals(DialogResult.OK))
	{
		QuestionAnswerTypeVo voAnswType = form.getGlobalContext().Core.getQuestionAnswerType();
		if (voAnswType != null)
		{
			DynamicGridRow row = null;
			if(voAnswType.getID_QuestionAnswerTypeIsNotNull())
				row = getDynamicRowByValue(voAnswType);
			else if (form.getLocalContext().getIsNewAnwerTypeIsNotNull())
				if (form.getLocalContext().getIsNewAnwerType())
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().newRow();
				else 
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getSelectedRow();
					
			createDynamicGridRow(voAnswType, row);				
			setDefaultDynamicGridCheckBox(voAnswType, true);
			enableContextMenu();
		}
	}		
	else if( formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
	{
		save(false);
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void setDefaultDynamicGridCheckBox(QuestionAnswerTypeVo voAnswType, boolean selectFirst)
{
	if (selectFirst && countDynRowBoolean() > 1)
		return;

	if (isScoringAssessmentQuestion() && isSingleOrMultiSelect(voAnswType.getAnswerType()))
	{
		for (int i = 0; i < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().size(); i++)
		{
			DynamicGridRow row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().get(i);
			for (int j = 0; j < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().size(); j++)
			{
				DynamicGridCell cell = row.getCells().get(form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().get(j));
				if (cell != null && cell.getType() == DynamicCellType.BOOL)
				{
					cell.setValue(new Boolean(true));
					return;
				}
			}
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(formName.equals(form.getForms().Core.TaxonomySearch) && result.equals(DialogResult.OK))
	{
		TaxonomyMap voTaxonomy = form.getGlobalContext().Core.getTaxonomyMap();
		if(voTaxonomy != null)
		{
			//Check for duplicates
			if(form.grdTaxonomy().getValues().indexOf(voTaxonomy) < 0)
				setTaxonomyGridRowData(form.grdTaxonomy().getRows().newRow(true), form.getGlobalContext().Core.getTaxonomyMap());
		}
	}
	if(formName.equals(form.getForms().Core.QuestionAnswerType) && result.equals(DialogResult.OK))
	{
		QuestionAnswerTypeVo voAnswType = form.getGlobalContext().Core.getQuestionAnswerType();
		if(voAnswType != null)
		{
			GenForm.grdAnswerTypeRow row = form.grdAnswerType().getRowByValue(voAnswType);
			if(row == null)
				row = form.grdAnswerType().getRows().newRow(true);   
			setAnswerGridRowData(row, voAnswType);
			enableContextMenu();
		}
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addAnswerType()
{
	QuestionAnswerTypeVo voQAnswer = new QuestionAnswerTypeVo();
	voQAnswer.setActiveStatus(new Boolean(true));
	form.getGlobalContext().Core.setQuestionAnswerType(voQAnswer);
	form.getLocalContext().setIsNewAnwerType(new Boolean(true));
	engine.open(form.getForms().Core.QuestionAnswerType);
/*	if(form.qmbLookupType().getValue() == null)
	{
		engine.showMessage("Please select a Lookup Type first");
		form.qmbLookupType().setFocus();
		return;
	}*/
	/*grdAnswerTypeRow row = form.grdAnswerType().getRows().newRow(true);
	form.grdAnswerType().setEnabled(true);
	form.grdAnswerType().setReadOnly(false);
	row.setReadOnly(false);
	enableContextMenu();*/
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private QuestionAnswerTypeVoCollection getAnswerTypes() 
{
	//Get the active ones - from the grid 
	QuestionAnswerTypeVoCollection voColl = form.grdAnswerType().getValues();
	//Add the inactive ones
	QuestionAnswerTypeVoCollection voInactiveColl = form.getLocalContext().getInactiveAnswerTypes();
	QuestionAnswerTypeVo voQAnswType;
	if(voInactiveColl != null)
	{
		for (int i = 0; i < voInactiveColl.size(); i++) 
		{
			voQAnswType = voInactiveColl.get(i);
			voColl.add(voQAnswType);
		}
	}
	return voColl;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected QuestionAnswerTypeVo copy(QuestionAnswerTypeVo answer) { 
    try 
    { 
        ByteArrayOutputStream baostream = new ByteArrayOutputStream(); 
        ObjectOutputStream oostream = new ObjectOutputStream(baostream); 
        oostream.writeObject(answer); 
        oostream.flush(); 
        oostream.close(); 
        ByteArrayInputStream baistream = new ByteArrayInputStream(baostream.toByteArray()); 
        ObjectInputStream oistream = new ObjectInputStream(baistream); 
        QuestionAnswerTypeVo auxAnswer = (QuestionAnswerTypeVo)oistream.readObject(); 
        oistream.close();            
        return auxAnswer; 
    } 
    catch(Throwable t) 
    { 
    	String error[]={t.getMessage()};
        engine.showErrors(error);
        return null;
    } 
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void open()
{
	QuestionAnswerTypeVo voQAnswerType = form.getGlobalContext().Core.getQuestionAnswerType();

	if (voQAnswerType != null)
	{
		populateScreenFromData(voQAnswerType);
		populateAnswerOptions(voQAnswerType);
	}
	
	setAnswerTypeInitialValue();
	
	form.setMode(isDialogViewMode() ? FormMode.VIEW : FormMode.EDIT);
	cmbAnswerTypeValueChanged();
	setGridAnswerOptionStat();
	customizeScoringAssessment();
	enableContextMenu();
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private DynamicGridCell findCell(DynamicGridRow questionRow, QuestionAnswerTypeVo answerType)
{
	if (questionRow == null)
		return null;
	if (answerType == null)
		return null;
	for (int x = 0; x < this.grid.getColumns().size(); x++)
	{
		DynamicGridCell cell = questionRow.getCells().get(this.grid.getColumns().get(x));

		if (cell != null && cell.getIdentifier() != null)
		{
			if (cell.getIdentifier() instanceof QuestionAnswerTypeVo && cell.getIdentifier().equals(answerType))
				return cell;
			else if (cell.getIdentifier() instanceof AnswerCellData && ((AnswerCellData) cell.getIdentifier()).getConfigData().equals(answerType))
				return cell;
		}
	}

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

	for (int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);
		if (answer != null && answer.getAnswerDetails() != null)
		{
			for (int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if (answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}
	}

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

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

	return null;
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	//WDEV-17363
	if (Boolean.TRUE.equals(form.dyngrdAnswers().isReadOnly()))
		return;
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 12
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private static String getPreviousSeparatorIfExists(AssessmentQuestionVo assessmentQuestion, QuestionAnswerTypeVo ansType)
{
	if(assessmentQuestion == null || ansType == null)
		return null;
	
	if(assessmentQuestion.getQuestion() == null || assessmentQuestion.getQuestion().getAnswerTypes() == null)
		return null;
	
	for (int i = 0; i < assessmentQuestion.getQuestion().getAnswerTypes().size(); i++)
	{
		QuestionAnswerTypeVo voQuestionAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i);
		if(voQuestionAnswerType != null && voQuestionAnswerType.equals(ansType))
		{
			if(i > 0)
			{
				QuestionAnswerTypeVo voPrevAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i-1);
				if(voPrevAnswerType != null && voPrevAnswerType.getAnswerTypeIsNotNull() && voPrevAnswerType.getAnswerType().equals(QuestionAnswerType.SEPARATOR))
					return voPrevAnswerType.getSeparatorText();
			}
		}
	}
	return null;
}
 
Example 13
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private DynamicGridCell findCell(DynamicGridRow questionRow, QuestionAnswerTypeVo answerType)
{
	if(questionRow == null)
		return null;
	if(answerType == null)
		return null;
	for(int x = 0; x < this.grid.getColumns().size(); x++)
	{
		DynamicGridCell cell = questionRow.getCells().get(this.grid.getColumns().get(x));
		
		if(cell != null && cell.getIdentifier() != null)
		{										
				if(cell.getIdentifier() instanceof QuestionAnswerTypeVo && cell.getIdentifier().equals(answerType))
					return cell;
				else if(cell.getIdentifier() instanceof AnswerCellData && ((AnswerCellData)cell.getIdentifier()).getConfigData().equals(answerType))
					return cell;
		}			
	}
	
	return null;
}
 
Example 14
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentQuestionVo instQuestion, QuestionAnswerTypeVo configAnswerType)
{
	if(instQuestion == null || instQuestion.getPatientAnswers() == null || instQuestion.getPatientAnswers().size() == 0 || configAnswerType == null)
		return null;
	
	for(int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);		
		if(answer != null && answer.getAnswerDetails() != null)
		{
			for(int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if(answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}		
	}
	
	return null;
}
 
Example 15
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 16
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer, boolean readOnly) throws PresentationLogicException 
{
	checkDataIntegrity(configAnswer);

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);
	
	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);				
	setCellTooltip(cell, configAnswer);
	if(isDPP && cellAnswerType != null && cellAnswerType.equals(DynamicCellType.MULTISELECT))
	{
		cell.setAutoPostBack(true);
	}
	
	return cell;
}
 
Example 17
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 18
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer, boolean readOnly)  throws PresentationLogicException
{
	checkDataIntegrity(configAnswer);

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);
	
	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);
	setCellAnswer(cell, instAnswer);
	
	if (instAnswer == null)
	{
		setCellTooltip(cell, configAnswer);
	}
	else //WDEV-16927
	{
		setCellAnswerTooltip(cell, instAnswer);
	}
	
	return cell;
}
 
Example 19
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private DynamicGridCell findCell(DynamicGridRow questionRow, QuestionAnswerTypeVo answerType)
{
	if(questionRow == null)
		return null;
	if(answerType == null)
		return null;
	for(int x = 0; x < this.gridQuestions.getColumns().size(); x++)
	{
		DynamicGridCell cell = questionRow.getCells().get(this.gridQuestions.getColumns().get(x));
		
		if(cell != null && cell.getIdentifier() != null && cell.getIdentifier() instanceof QuestionAnswerTypeVo)
		{										
			if(cell.getIdentifier().equals(answerType))
				return cell;
		}			
	}
	
	return null;
}
 
Example 20
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer) 
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes);
		cell.getItems().newItem(this.optionNo);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))				
	{
		setAnswerCellOptions(configAnswer, cell);
		if(configAnswer.getMaxMultiselectAllowedIsNotNull())
		{
			cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
		}								
	}
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if (patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;

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

	return null;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(formName.equals(form.getForms().Core.TaxonomySearch) && result.equals(DialogResult.OK))
	{
		TaxonomyMap voTaxonomy = form.getGlobalContext().Core.getTaxonomyMap();
		if(voTaxonomy != null)
		{
			//Check for duplicates
			if(form.grdTaxonomy().getValues().indexOf(voTaxonomy) < 0)
				setTaxonomyGridRowData(form.grdTaxonomy().getRows().newRow(true), form.getGlobalContext().Core.getTaxonomyMap());
		}
	}
	if(formName.equals(form.getForms().Core.QuestionAnswerType) && result.equals(DialogResult.OK))
	{
		QuestionAnswerTypeVo voAnswType = form.getGlobalContext().Core.getQuestionAnswerType();
		if(voAnswType != null)
		{
			GenForm.grdAnswerTypeRow row = form.grdAnswerType().getRowByValue(voAnswType);
			if(row == null)
				row = form.grdAnswerType().getRows().newRow(true);   
			setAnswerGridRowData(row, voAnswType);
			enableContextMenu();
		}
	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	//WDEV-17363
	if (Boolean.TRUE.equals(form.dyngrdAnswers().isReadOnly()))
		return;
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}
 
Example 24
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void addAnswerType()
{
	QuestionAnswerTypeVo voQAnswer = new QuestionAnswerTypeVo();
	voQAnswer.setActiveStatus(new Boolean(true));
	form.getGlobalContext().Core.setQuestionAnswerType(voQAnswer);
	form.getLocalContext().setIsNewAnwerType(new Boolean(true));
	engine.open(form.getForms().Core.QuestionAnswerType);
/*	if(form.qmbLookupType().getValue() == null)
	{
		engine.showMessage("Please select a Lookup Type first");
		form.qmbLookupType().setFocus();
		return;
	}*/
	/*grdAnswerTypeRow row = form.grdAnswerType().getRows().newRow(true);
	form.grdAnswerType().setEnabled(true);
	form.grdAnswerType().setReadOnly(false);
	row.setReadOnly(false);
	enableContextMenu();*/
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private QuestionAnswerTypeVoCollection getAnswerTypes() 
{
	//Get the active ones - from the grid 
	QuestionAnswerTypeVoCollection voColl = form.grdAnswerType().getValues();
	//Add the inactive ones
	QuestionAnswerTypeVoCollection voInactiveColl = form.getLocalContext().getInactiveAnswerTypes();
	QuestionAnswerTypeVo voQAnswType;
	if(voInactiveColl != null)
	{
		for (int i = 0; i < voInactiveColl.size(); i++) 
		{
			voQAnswType = voInactiveColl.get(i);
			voColl.add(voQAnswType);
		}
	}
	return voColl;
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentQuestionVo instQuestion, QuestionAnswerTypeVo configAnswerType)
{
	if (instQuestion == null || instQuestion.getPatientAnswers() == null || instQuestion.getPatientAnswers().size() == 0 || configAnswerType == null)
		return null;

	for (int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);
		if (answer != null && answer.getAnswerDetails() != null)
		{
			for (int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if (answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}
	}

	return null;
}
 
Example 27
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private static String getPreviousSeparatorIfExists(AssessmentQuestionVo assessmentQuestion, QuestionAnswerTypeVo ansType)
{
	if(assessmentQuestion == null || ansType == null)
		return null;
	
	if(assessmentQuestion.getQuestion() == null || assessmentQuestion.getQuestion().getAnswerTypes() == null)
		return null;
	
	for (int i = 0; i < assessmentQuestion.getQuestion().getAnswerTypes().size(); i++)
	{
		QuestionAnswerTypeVo voQuestionAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i);
		if(voQuestionAnswerType != null && voQuestionAnswerType.equals(ansType))
		{
			if(i > 0)
			{
				QuestionAnswerTypeVo voPrevAnswerType = assessmentQuestion.getQuestion().getAnswerTypes().get(i-1);
				if(voPrevAnswerType != null && voPrevAnswerType.getAnswerTypeIsNotNull() && voPrevAnswerType.getAnswerType().equals(QuestionAnswerType.SEPARATOR))
					return voPrevAnswerType.getSeparatorText();
			}
		}
	}
	return null;
}
 
Example 28
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private DynamicGridCell findCell(DynamicGridRow questionRow, QuestionAnswerTypeVo answerType)
{
	if(questionRow == null)
		return null;
	if(answerType == null)
		return null;
	for(int x = 0; x < this.grid.getColumns().size(); x++)
	{
		DynamicGridCell cell = questionRow.getCells().get(this.grid.getColumns().get(x));
		
		if(cell != null && cell.getIdentifier() != null)
		{										
				if(cell.getIdentifier() instanceof QuestionAnswerTypeVo && cell.getIdentifier().equals(answerType))
					return cell;
				else if(cell.getIdentifier() instanceof AnswerCellData && ((AnswerCellData)cell.getIdentifier()).getConfigData().equals(answerType))
					return cell;
		}			
	}
	
	return null;
}
 
Example 29
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentQuestionVo instQuestion, QuestionAnswerTypeVo configAnswerType)
{
	if (instQuestion == null || instQuestion.getPatientAnswers() == null || instQuestion.getPatientAnswers().size() == 0 || configAnswerType == null)
		return null;

	for (int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);
		if (answer != null && answer.getAnswerDetails() != null)
		{
			for (int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if (answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}
	}

	return null;
}
 
Example 31
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 32
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentQuestionVo instQuestion, QuestionAnswerTypeVo configAnswerType)
{
	if(instQuestion == null || instQuestion.getPatientAnswers() == null || instQuestion.getPatientAnswers().size() == 0 || configAnswerType == null)
		return null;
	
	for(int x = 0; x < instQuestion.getPatientAnswers().size(); x++)
	{
		PatientAssessmentAnswerVo answer = instQuestion.getPatientAnswers().get(x);		
		if(answer != null && answer.getAnswerDetails() != null)
		{
			for(int y = 0; y < answer.getAnswerDetails().size(); y++)
			{
				if(answer.getAnswerDetails().get(y).getAnswerTypeIsNotNull() && answer.getAnswerDetails().get(y).getAnswerType().equals(configAnswerType))
				{
					return answer.getAnswerDetails().get(y);
				}
			}
		}		
	}
	
	return null;
}
 
Example 33
Project: openMAXIMS   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer) 
{
	if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes);
		cell.getItems().newItem(this.optionNo);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if(configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))				
	{
		setAnswerCellOptions(configAnswer, cell);
		if(configAnswer.getMaxMultiselectAllowedIsNotNull())
		{
			cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
		}								
	}
}
 
Example 34
Project: openmaxims-linux   File: MyOrderQuestionsPopulation.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 35
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if (patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;

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

	return null;
}
 
Example 36
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer, boolean readOnly)
{

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);

	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);
	setCellAnswer(cell, instAnswer);

	if (instAnswer == null)
	{
		setCellTooltip(cell, configAnswer);
	}
	else
	{
		setCellAnswerTooltip(cell, instAnswer);
	}

	return cell;
}
 
Example 37
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
	if (formName.equals(form.getForms().Core.QuestionAnswerType) && result.equals(DialogResult.OK))
	{
		QuestionAnswerTypeVo voAnswType = form.getGlobalContext().Core.getQuestionAnswerType();
		if (voAnswType != null)
		{
			DynamicGridRow row = null;
			if(voAnswType.getID_QuestionAnswerTypeIsNotNull())
				row = getDynamicRowByValue(voAnswType);
			else if (form.getLocalContext().getIsNewAnwerTypeIsNotNull())
				if (form.getLocalContext().getIsNewAnwerType())
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().newRow();
				else 
					row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getSelectedRow();
					
			createDynamicGridRow(voAnswType, row);				
			setDefaultDynamicGridCheckBox(voAnswType, true);
			enableContextMenu();
		}
	}		
	else if( formName.equals(form.getForms().Core.YesNoDialog) && result.equals(DialogResult.YES))
	{
		save(false);
	}
}
 
Example 38
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void setDefaultDynamicGridCheckBox(QuestionAnswerTypeVo voAnswType, boolean selectFirst)
{
	if (selectFirst && countDynRowBoolean() > 1)
		return;

	if (isScoringAssessmentQuestion() && isSingleOrMultiSelect(voAnswType.getAnswerType()))
	{
		for (int i = 0; i < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().size(); i++)
		{
			DynamicGridRow row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().get(i);
			for (int j = 0; j < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().size(); j++)
			{
				DynamicGridCell cell = row.getCells().get(form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().get(j));
				if (cell != null && cell.getType() == DynamicCellType.BOOL)
				{
					cell.setValue(new Boolean(true));
					return;
				}
			}
		}
	}
}
 
Example 39
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AnswerDetailsVo getInstAnswerType(PatientAssessmentAnswerVoCollection patientAnswers, QuestionAnswerTypeVo configAnswerType)
{
	if(patientAnswers == null || patientAnswers.size() == 0 || configAnswerType == null)
		return null;
		
	for (int i = 0; i < patientAnswers.size(); i++)
	{
		PatientAssessmentAnswerVo voPatAssAnswerVo = patientAnswers.get(i);
		for (int j = 0; voPatAssAnswerVo != null && j < voPatAssAnswerVo.getAnswerDetails().size(); j++)
		{
			if(voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerTypeIsNotNull() && voPatAssAnswerVo.getAnswerDetails().get(j).getAnswerType().equals(configAnswerType))
			{
				return voPatAssAnswerVo.getAnswerDetails().get(j);
			}
		}
	}
	
	return null;
}
 
Example 40
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		return;
	}
	
	//WDEV-17363
	if (Boolean.TRUE.equals(form.dyngrdAnswers().isReadOnly()))
		return;
	
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		cell.setTooltip("Select date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		cell.setTooltip("Enter decimal value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		cell.setTooltip("Enter numeric value");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		cell.setTooltip("Enter partial date");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		cell.setTooltip("Enter text");
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		cell.setTooltip("Enter time");
}