Java Code Examples for ims.framework.controls.DynamicGridCell.getIdentifier()

The following are Jave code examples for showing how to use getIdentifier() of the ims.framework.controls.DynamicGridCell class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
protected void onDyngrdAssessmentsCellButtonClicked(DynamicGridCell cell)
{
	if(cell != null)
	{
		if(cell.getColumn() != null && cell.getColumn().equals(getDynGridColumn(HELP_URL_COLUMN)))
		{
			if(cell.getIdentifier() != null)
			{
				Object identifier = cell.getIdentifier();
				if(identifier instanceof String)
				{
					engine.openUrl((String)identifier);
				}
			}
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
protected void onDyngrdAssessmentsCellButtonClicked(DynamicGridCell cell)
{
	if (cell != null)
	{
		if (cell.getColumn() != null && cell.getColumn().equals(getDynGridColumn(HELP_URL_COLUMN)))
		{
			if (cell.getIdentifier() != null)
			{
				Object identifier = cell.getIdentifier();
				if (identifier instanceof String)
				{
					engine.openUrl((String) identifier);
				}
			}
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
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 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
protected void onDyngrdAssessmentsCellButtonClicked(DynamicGridCell cell)
{
	if(cell != null)
	{
		if(cell.getColumn() != null && cell.getColumn().equals(getDynGridColumn(HELP_URL_COLUMN)))
		{
			if(cell.getIdentifier() != null)
			{
				Object identifier = cell.getIdentifier();
				if(identifier instanceof String)
				{
					engine.openUrl((String)identifier);
				}
			}
		}
	}
}
 
Example 5
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 6 votes
public void add_OrRemoveAnswer(DynamicGridCell initiatorCell)
{
	if(initiatorCell == null || initiatorCell.getIdentifier() == null)
		return;
	if(!initiatorCell.getIdentifier().equals(BUTTON_ADD_ANSWER) 
			&& !initiatorCell.getIdentifier().equals(BUTTON_REMOVE_ANSWER))
		return;
	
	checkDataIntegrity(initiatorCell.getRow());
	
	if(initiatorCell.getIdentifier().equals(BUTTON_REMOVE_ANSWER))
	{
		if(initiatorCell.getRow().getParent() != null)
			initiatorCell.getRow().getParent().getRows().remove(initiatorCell.getRow());
		else
			this.grid.getRows().remove(initiatorCell.getRow());
	}
	else
	{			
		duplicate_QuestionRow(initiatorCell.getRow());
	}			
}
 
Example 6
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 6 votes
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 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private Object getComboValues(Integer type)
{
	int size = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabTNM().dynGrdPreTreatment().getRows().size();

	for (int i = 0; i < size; i++)
	{
		DynamicGridCell dynamicGridCell = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabTNM().dynGrdPreTreatment().getRows().get(i).getCells().get(getColumn(COLTYPE_VALUE));
		Object id = dynamicGridCell.getIdentifier();
		
		if (id == type)
			return dynamicGridCell.getValue();
	}

	return null;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
@Override
protected void onDyngrdOrganisationLocationCellButtonClicked(DynamicGridCell cell)
{
	form.dyngrdOrganisationLocation().setSelectedRow(cell.getRow());
	
	
	DynamicGridCell cellAccreditation = cell.getRow().getCells().get(form.dyngrdOrganisationLocation().getColumns().getByIdentifier(COL_ACCREDITATION));
	if (cellAccreditation.getValue() == null || (cellAccreditation.getValue() != null
		&& ( !((AccreditationLocationStatus)cellAccreditation.getValue()).equals(AccreditationLocationStatus.RESTICT_ACCRED)
			 && !((AccreditationLocationStatus)cellAccreditation.getValue()).equals(AccreditationLocationStatus.RESTRICT_ACCRED_REFERRING))) )
		return;
	
	if (form.dyngrdOrganisationLocation().getSelectedRow() != null
		&& form.dyngrdOrganisationLocation().getSelectedRow().getValue() != null
		&& form.dyngrdOrganisationLocation().getSelectedRow().getValue() instanceof HcpLocationVo )
		form.getGlobalContext().NTPF.setCaseTypes(((HcpLocationVo) form.dyngrdOrganisationLocation().getSelectedRow().getValue()) != null ? ((HcpLocationVo) form.dyngrdOrganisationLocation().getSelectedRow().getValue()).getCaseTypes() : null);
	else if (cell.getIdentifier() != null 
		&& cell.getIdentifier() instanceof CaseTypeCollection)
	{
		form.getGlobalContext().NTPF.setCaseTypes((CaseTypeCollection)cell.getIdentifier());
	}
	else
	{
		form.getGlobalContext().NTPF.setCaseTypes(null);
	}
	
	engine.open(form.getForms().Admin.NTPFCaseTypeConfigDialog);
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
@Override
protected void onDyngrdCellButtonClicked(DynamicGridCell cell) 
{
	if(cell != null && cell.getIdentifier() != null)
	{
		ims.vo.interfaces.IChartValue comments = (ims.vo.interfaces.IChartValue) cell.getIdentifier();
		DynamicGridCell nameCell = cell.getRow().getCells().get(form.dyngrd().getColumns().getByIdentifier(COLUMN_NAME));
		displayComments(nameCell.getValue().toString(), comments);
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
protected void onDyngrdInviteesCellTextSubmited(DynamicGridCell cell) 
{
	cell.getItems().clear();
	if (cell.getTypedText() == null || cell.getTypedText().equals(""))
	{
		engine.showMessage("Please enter at least one character to search on.");
		return;
	}

	if (cell.getIdentifier() != null && cell.getIdentifier().equals(HcpLiteVo.class))
	{
		HcpLiteVoCollection collHcps = domain.listHcpLiteVoByName(cell.getTypedText());
		//MemberOfStaffShortVoCollection voCollMos = domain.listMos(cell.getTypedText());
		if (collHcps != null && collHcps.size() > 0)
		{
			for (int i = 0; i < collHcps.size(); i++)
			{
				cell.getItems().newItem(collHcps.get(i));
			}
			if (collHcps.size() == 1)
			{
				cell.setValue(collHcps.get(0));
				onDyngrdInviteesCellValueChanged(cell);
			}
			else if (collHcps.size() > 1)
				cell.showOpened();
		}
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
protected void onDyngrdInviteesCellValueChanged(DynamicGridCell cell) 
{
	if (cell.getIdentifier() != null)
	{
		DynamicGridRow row = cell.getRow();

		if (cell.getIdentifier().equals(HcpLiteVo.class))
		{
			row.setValue(((HcpLiteVo) cell.getValue()));
		}
	}
}
 
Example 12
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 5 votes
private DynamicGridCell getDppAnswerCell(DynamicGridRow row)
{
	for(int x = 0; x < this.grid.getColumns().size(); x++)
	{
		DynamicGridCell cell = row.getCells().get(this.grid.getColumns().get(x));
		
		if(cell != null && !cell.getType().equals(DynamicCellType.DYNAMICLABEL) && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && (cell.getIdentifier() instanceof QuestionAnswerTypeVo || cell.getIdentifier() instanceof AnswerCellData))
		{										
			return cell;					
		}			
	}
	
	return null;
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
protected void onDyngrdReportToCellValueChanged(DynamicGridCell cell)
{
	if (cell.getIdentifier() != null)
	{
		DynamicGridRow row = cell.getRow();
		DynamicGridCell cellAddress = row.getCells().get(form.lyrDetails().tabGenDetails().dyngrdReportTo().getColumns().getByIdentifier(ADDRESS_COLUMN));
		DynamicGridCell cellWardClinic = row.getCells().get(form.lyrDetails().tabGenDetails().dyngrdReportTo().getColumns().getByIdentifier(WARDOUTPAT_COLUMN));

		if (cell.getIdentifier().equals(MemberOfStaffRefVo.class))
		{
			MemberOfStaffShortVo voMos = ((MemberOfStaffShortVo) cell.getValue());

			if (voMos != null && voMos.getPrimaryLocationIsNotNull() && voMos.getPrimaryLocation().getAddressIsNotNull())
			{
				cellAddress.setValue(((MemberOfStaffShortVo) cell.getValue()).getPrimaryLocation().getAddress().toDisplayString());
				cellAddress.setTooltip(((MemberOfStaffShortVo) cell.getValue()).getPrimaryLocation().getAddress().toDisplayString());
			}
			else
			{
				cellAddress.setValue(null);
				cellAddress.setTooltip(null);
			}
		}
		else if (cell.getIdentifier().equals(GpRefVo.class))
		{
			GpShortVo voGp = ((GpShortVo) cell.getValue());

			if (voGp != null && voGp.getPracticesIsNotNull() && voGp.getPractices().size() > 0 && voGp.getPractices().get(0).getPracticeIsNotNull() && voGp.getPractices().get(0).getPractice().getAddressIsNotNull())
			{
				cellAddress.setValue(((GpShortVo) cell.getValue()).getPractices().get(0).getPractice().getAddress().toDisplayString());
				cellAddress.setTooltip(((GpShortVo) cell.getValue()).getPractices().get(0).getPractice().getAddress().toDisplayString());
			}
			else
			{
				cellAddress.setValue(null);
				cellAddress.setTooltip(null);
			}
		}
		else if (cell.getIdentifier().equals(LocationType.HOSP) && cell.getValue() != null)
		{
			if (cell.getValue() == null)
				cellWardClinic.setReadOnly(true);
			else
				cellWardClinic.setReadOnly(false);

			cellWardClinic.setTypedText(null);
			cellWardClinic.getItems().clear();
			cellAddress.setValue(null);
		}
		else if ((cell.getIdentifier().equals(LocationType.WARD) || cell.getIdentifier().equals(LocationType.OUTPATIENT_DEPT)) && cell.getValue() != null)
		{
			LocShortVo voLocation = (LocShortVo) cell.getValue();

			if (voLocation != null && voLocation.getAddressIsNotNull())
				cellAddress.setValue(voLocation.getAddress().toDisplayString());
			else
				cellAddress.setValue(null);
		}
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
@Override
protected void onDyngrdParametersCellTextSubmited(DynamicGridCell cell)
{
	if (cell == null)
		return;

	if (isCustomSearchSeedCell(cell))
	{
		listCustomSearchSeed(cell);
		return;
	}

	if (cell.getType().equals(DynamicCellType.QUERYCOMBOBOX))
	{
		Object identifier = cell.getIdentifier();
		if (identifier != null)
		{
			if (identifier.equals(ReportSeedsHelper.GP_BO))
			{
				listGps(cell);
			}

			if (identifier.equals(ReportSeedsHelper.HCP_BO))
			{
				listHCPs(cell, null);
			}

			if (identifier.equals(ReportSeedsHelper.MEDIC_BO))
			{
				listHCPs(cell, HcpDisType.MEDICAL);
			}

			if (identifier.equals(ReportSeedsHelper.MOS_BO))
			{
				listMOS(cell);
			}

			if (identifier.equals(ReportSeedsHelper.ORG_BO))
			{
				listOrganisation(cell);
			}

			if (identifier.equals(ReportSeedsHelper.LOCATION_BO))
			{
				listLocation(cell);
			}

			if (identifier.equals(ReportSeedsHelper.LOC_SITE_BO))
			{
				listLocSite(cell);
			}							
		}
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void setCellAnswer(DynamicGridCell cell, Answer_DetailsVo answer)
{
	if (cell == null)
		return;
	if (answer == null)
		return;
	Question_AnswerTypeVo answerType = null;
	if (cell.getIdentifier() instanceof Question_AnswerTypeVo)
		answerType = (Question_AnswerTypeVo) cell.getIdentifier();
	else if (cell.getIdentifier() instanceof Answer_CellData)
		answerType = ((Answer_CellData) cell.getIdentifier()).getConfigData();

	cell.setIdentifier(new Answer_CellData(answerType, answer));

	if (cell.getType() == DynamicCellType.ANSWER)
	{
		if (answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if (cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if (cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if (cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if (cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());
	}
	else if (cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if (cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if (cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.MULTISELECT)
	{
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private Patient_AssessmentQuestionVoCollection getQuestionRowAnswer(DynamicGridRow row, Patient_AssessmentQuestionVoCollection answers)
{
	if (row == null || row.getIdentifier() == null)
		return answers;

	if (answers == null)
		answers = new Patient_AssessmentQuestionVoCollection();

	Assessment_QuestionVo question = (Assessment_QuestionVo) row.getIdentifier();
	Patient_AssessmentQuestionVo answer = findOrCreateAnswer(answers, question);

	answer.setAssessmentQuestion(question);
	AnswerStatus status = AnswerStatus.ANSWERED;
	if (isDPP)
	{
		DynamicGridColumn column = this.grid.getColumns().getByIdentifier(NOTAPPLICABLE_COLUMN);
		if (column != null)

		{
			DynamicGridCell cellNA = row.getCells().get(column);
			if (cellNA.getValue() instanceof Boolean && ((Boolean) cellNA.getValue()).booleanValue())
				status = AnswerStatus.NOTAPPLICABLE;
		}
	}
	answer.setIsAnswered(status);
	answer.setIsMandatory(question.getIsMandatory());
	answer.setAllowsMultipleAnswers(question.getAllowsMultipleAnswersIsNotNull() ? question.getAllowsMultipleAnswers() : Boolean.FALSE);
	answer.setSequence(new Integer(overallQuestionSequence++));

	Answer_DetailsVoCollection answerDetails = new Answer_DetailsVoCollection();

	for (int x = 0; x < this.grid.getColumns().size(); x++)
	{
		DynamicGridCell cell = row.getCells().get(this.grid.getColumns().get(x));

		if (cell != null && !cell.getType().equals(DynamicCellType.DYNAMICLABEL) && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && (cell.getIdentifier() instanceof Question_AnswerTypeVo || cell.getIdentifier() instanceof Answer_CellData))
		{
			answerDetails.add(get_CellAnswer(cell));
		}
	}

	Patient_AssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	if (patientAnswers == null)
		patientAnswers = new Patient_AssessmentAnswerVoCollection();
	else if (isFirstAnswer(row))
		patientAnswers.clear();

	Patient_AssessmentAnswerVo patientAnswer = (Patient_AssessmentAnswerVo) row.getValue();
	if (patientAnswer == null)
		patientAnswer = new Patient_AssessmentAnswerVo();

	patientAnswer.setAnswerDetails(answerDetails);
	patientAnswers.add(patientAnswer);

	answer.setPatientAnswers(patientAnswers);
	answers.add(answer);
	
	return answers;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void editChildRow(DynamicGrid grid, Float requiredVal, Float containerVal, DynamicGridRow childRow, OrderInvestigationVo voOrderInvestigation, boolean bProfileProcessed)
{
	if (!(childRow.getValue() instanceof OrderInvestigationVoCollection))
		childRow.setValue(new OrderInvestigationVoCollection());
	((OrderInvestigationVoCollection) childRow.getValue()).add(voOrderInvestigation);
	
	// modify the tooltip
	DynamicGridCell cellDiscipline = childRow.getCells().get(grid.getColumns().getByIdentifier(DISCIPLINE_COLUMN));
	DynamicGridCell cellSpecimenType = childRow.getCells().get(grid.getColumns().getByIdentifier(SPECIMENTYPE_COLUMN));
	String invName = voOrderInvestigation.getInvestigation().getInvestigationIndex().getName();
	if (cellDiscipline.getTooltip() != null)
		cellDiscipline.setTooltip(cellDiscipline.getTooltip() + ", " + invName);

	if (cellSpecimenType.getTooltip() != null)
		cellSpecimenType.setTooltip(cellSpecimenType.getTooltip() + ", " + invName);
	
	Float thisval = (Float) cellDiscipline.getIdentifier();
	// updating the total required for container
	if (cellSpecimenType.getValue() != null && cellSpecimenType.getValue() instanceof String)
	{
		
		thisval += requiredVal;
		// WDEV-12280
		if (ConfigFlag.UI.OCS_ORDERING_DISPLAY_BLOOD_VOLUMES.getValue())
		{
			int beginIndex = cellSpecimenType.getValue().toString().indexOf(" - ");
			cellSpecimenType.setValue(cellSpecimenType.getValue().toString().substring(0, beginIndex) + " - " + String.valueOf(thisval) + " mls");
		}
		
		cellDiscipline.setIdentifier(thisval);
	}

	if (voOrderInvestigation.getInvestigationIsNotNull() && voOrderInvestigation.getInvestigation().getIsAddonIsNotNull() && voOrderInvestigation.getInvestigation().getIsAddon().booleanValue())
		return;

	DynamicGridCell cellQty = childRow.getCells().get(grid.getColumns().getByIdentifier(QTY_COLUMN));
	if (cellQty != null)
	{
		if (!bProfileProcessed)
			cellQty.setValue(calculateQuantity(grid, childRow, thisval, containerVal));
	}
}
 
Example 18
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private void setCellAnswer(DynamicGridCell cell, Answer_DetailsVo answer)
{
	if (cell == null)
		return;
	if (answer == null)
		return;

	Question_AnswerTypeVo answerType = null;

	if (cell.getIdentifier() instanceof Question_AnswerTypeVo)
		answerType = (Question_AnswerTypeVo) cell.getIdentifier();
	else if (cell.getIdentifier() instanceof AnswerCellData)
		answerType = ((Answer_CellData) cell.getIdentifier()).getConfigData();

	cell.setIdentifier(new Answer_CellData(answerType, answer));
	
	if(cell.getType() == DynamicCellType.ANSWER)
	{
		if(answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if(cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if(cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if(cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if(cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());			
	}
	else if(cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if(cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if(cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.MULTISELECT)
	{			
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}
 
Example 19
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private Patient_GraphicAssessmentQuestionAnswerVoCollection updateGraphicQuestion(Patient_GraphicAssessmentQuestionAnswerVoCollection answers, DynamicGridRow row)
{
	if(answers == null)
		answers = new Patient_GraphicAssessmentQuestionAnswerVoCollection();		
	if(row == null || NON_DATA_ROW.equals(row.getIdentifier()))
		return answers;
	
	
	Graphic_AssessmentQuestionVo question = (Graphic_AssessmentQuestionVo)row.getIdentifier();
	Patient_GraphicAssessmentQuestionAnswerVo answer = findOrCreateAnswer(answers, question);
	
	answer.setGraphicQuestion(question);
	answer.setIsMandatory(question.getIsMandatory());
			
	Answer_DetailsVoCollection answerDetails = new Answer_DetailsVoCollection();
	
	for(int x = 0; x < this.grid.getColumns().size(); x++)
	{
		DynamicGridCell cell = row.getCells().get(this.grid.getColumns().get(x));
		
		if(cell != null && !cell.getType().equals(DynamicCellType.DYNAMICLABEL) && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && (cell.getIdentifier() instanceof Question_AnswerTypeVo || cell.getIdentifier() instanceof Answer_CellData))
		{										
			answerDetails.add(get_CellAnswer(cell));					
		}			
	}
	
	Patient_AssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	if(patientAnswers == null)
		patientAnswers = new Patient_AssessmentAnswerVoCollection();			
	
	Patient_AssessmentAnswerVo patientAnswer = (Patient_AssessmentAnswerVo)row.getValue();
	if(patientAnswer == null)
		patientAnswer = new Patient_AssessmentAnswerVo();

	if(isFirstAnswer(row))
		patientAnswers.clear();
	
	//PatientAssessmentAnswerVo patientAnswer = new PatientAssessmentAnswerVo();
	patientAnswer.setAnswerDetails(answerDetails);		
	patientAnswers.add(patientAnswer);
	
	answer.setPatientAnswers(patientAnswers);
	answer.setIsAnswered(isAnswered(answer));
	
	answers.add(answer);
	return answers;
}
 
Example 20
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private Patient_GraphicAssessmentFindingQuestionAnswerVoCollection updateGraphicFindingQuestion(Patient_GraphicAssessmentFindingQuestionAnswerVoCollection answers, DynamicGridRow row)
{
	if(answers == null)
		answers = new Patient_GraphicAssessmentFindingQuestionAnswerVoCollection();		
	if(row == null || NON_DATA_ROW.equals(row.getIdentifier()))
		return answers;
	
	Graphic_AssessmentFindingQuestionVo question = (Graphic_AssessmentFindingQuestionVo)row.getIdentifier();
	Patient_GraphicAssessmentFindingQuestionAnswerVo answer = findOrCreateAnswer(answers, question);
	
	answer.setGraphicFindingQuestion(question);
	answer.setIsMandatory(question.getIsMandatory());
			
	Answer_DetailsVoCollection answerDetails = new Answer_DetailsVoCollection();
	
	for(int x = 0; x < this.grid.getColumns().size(); x++)
	{
		DynamicGridCell cell = row.getCells().get(this.grid.getColumns().get(x));
		
		//we save the separators as well
		//if(cell != null && !cell.getType().equals(DynamicCellType.DYNAMICLABEL) && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && cell.getIdentifier() instanceof QuestionAnswerTypeVo)
		if(cell != null && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && (cell.getIdentifier() instanceof Question_AnswerTypeVo || cell.getIdentifier() instanceof Answer_CellData))
		{										
			answerDetails.add(get_CellAnswer(cell));					
		}			
	}
	
	Patient_AssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	if(patientAnswers == null)
		patientAnswers = new Patient_AssessmentAnswerVoCollection();
	else if(isFirstAnswer(row))
		patientAnswers.clear();
	
	Patient_AssessmentAnswerVo patientAnswer = (Patient_AssessmentAnswerVo)row.getValue();
	if(patientAnswer == null)
		patientAnswer = new Patient_AssessmentAnswerVo();
	
	patientAnswer.setAnswerDetails(answerDetails);		
	patientAnswers.add(patientAnswer);
	
	answer.setPatientAnswers(patientAnswers);	
	answer.setIsAnswered(isAnswered(answer));
	answers.add(answer);
	return answers;
}