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

The following are Jave code examples for showing how to use setTooltip() 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
private void setColAuthoringHCP(ClinicalNotesShortVo note, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Recording User");
	if (col == null)
		throw new DomainRuntimeException("No column for Identifier");

	DynamicGridCell dateCell = row.getCells().newCell(col, DynamicCellType.WRAPTEXT);
	StringBuffer value = new StringBuffer();
	
	if (note.getRecordingUserIsNotNull())
		value.append(note.getRecordingUser().toString());

	dateCell.setValue(value.toString());
	
	// Set cell tooltip
	dateCell.setTooltip(buildNoteTooltip(note));
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void setColAuthoringDate(ClinicalNotesShortVo note, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Recording Date");
	if (col == null)
		throw new DomainRuntimeException("No column for Identifier");
	
	DynamicGridCell dateCell = row.getCells().newCell(col, DynamicCellType.WRAPTEXT);
	StringBuffer value = new StringBuffer();

	if (note.getRecordingDateTimeIsNotNull())
	{
		value.append(note.getRecordingDateTime().toString());
	}

	dateCell.setValue(value.toString());
	dateCell.setTooltip(buildNoteTooltip(note));
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void setCellTooltip(DynamicGridCell cell, Question_AnswerTypeVo configAnswer, boolean readOnlyBecauseUserHasNoRoles)
{
	if(readOnlyBecauseUserHasNoRoles)//wdev-3709
	{
		cell.setTooltip("Role permissions do not allow you answer this question");
		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 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	getColumn(QUERY_COL).setAlignment(Alignment.RIGHT);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, item !=null?DynamicGridCellOptions.READ_ONLY_DATA_CELL:DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if(item != null)
	{
		if(item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void setColNeedReviewed(DynamicGridRow row, ClinicalNotesShortVoCollection voCollNotes, int i)
{
	DynamicGridColumn col = getCol("ICON");
	
	if(col == null)
		throw new DomainRuntimeException("No column for ICON");

	DynamicGridCell iconCell = row.getCells().newCell(col, DynamicCellType.IMAGE);

	StringBuffer value = new StringBuffer();

	if (voCollNotes.get(i).getForReviewDisciplineIsNotNull() &&
			voCollNotes.get(i).getSourceOfNoteIsNotNull())
	{
			value.append("Review Discipline: " + voCollNotes.get(i).getForReviewDiscipline().toString().toUpperCase());
	}
	
	iconCell.setTooltip(value.toString());
	iconCell.setValue(form.getImages().Admin.ClinicalTeam);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private boolean checkForValidEndDate(DynamicGridCell cell, DynamicGridRow row)
{
	DynamicGridCell end_dateCell = row.getCells().get(form.dyngrdOrganisationLocation().getColumns().getByIdentifier(COL_ACCREDITATION_END_DATE));
	 
	if (wasPreviousAccreditationACCREDITED(row.getValue())
 			&& getColByIdentifier(COL_ACCREDITATION_END_DATE) != null
 			&& end_dateCell != null && end_dateCell.getValue() == null)
	{
		engine.showMessage("An Accreditation End date is required for " + ((HcpLocationVo)row.getValue()).getLocation().getName() + ". Please enter one and save.", "Missing End Date", MessageButtons.OK, MessageIcon.ERROR);
				
		if (getColByIdentifier(COL_ACCREDITATION) != null)
		{
			cell = row.getCells().get(form.dyngrdOrganisationLocation().getColumns().getByIdentifier(COL_ACCREDITATION));
			if (cell != null && cell.getType().equals(DynamicCellType.ENUMERATION))
			{
				cell.setValue(AccreditationLocationStatus.ACCREDITED);
				cell.setIdentifier(AccreditationLocationStatus.ACCREDITED);
				cell.setWidth(200);
				cell.setTooltip(createAccreditationHistoryTooltip(((HcpLocationVo)row.getValue()).getAccreditationHistory(), ((HcpLocationVo)row.getValue()).getCaseTypes()));
			}
		}
		return false; 
	}
	return true;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void addOtherRowTodyngrdReportTo()
{
	DynamicGridRow row = form.ctnDetails().dyngrdInvitees().getRows().newRow();
	DynamicGridCell cellInvitee = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(INVITEE_COLUMN), DynamicCellType.STRING);
	cellInvitee.setWidth(100);
	cellInvitee.setTooltip("Please enter a Family Member Name");
	cellInvitee.setReadOnly(false);
	cellInvitee.setIdentifier(DynamicCellType.STRING);
	cellInvitee.setStringMaxLength(55);
	
	//Show a Label cell
	DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(STATUS_COLUMN), DynamicCellType.ENUMERATION);
	cellStatus.setReadOnly(false);
	cellStatus.setWidth(100);
	cellStatus.setTooltip("Please select a status");
	cellInvitee.setIdentifier(DynamicCellType.ENUMERATION);

	AttendanceStatusCollection collAttendStatus = ims.clinical.vo.lookups.LookupHelper.getAttendanceStatus(domain.getLookupService());
	for(int k = 0 ; k < collAttendStatus.size() ; k++) 
		cellStatus.getItems().newItem(collAttendStatus.get(k));
	
	DynamicGridCell cellNote = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(NOTE_COLUMN), DynamicCellType.STRING);
	cellNote.setWidth(-1);
	cellNote.setTooltip("Please enter a Note here");
	cellNote.setReadOnly(false);
	cellNote.setStringMaxLength(255);
	cellInvitee.setIdentifier(DynamicCellType.STRING);
	
	row.setValue(DynamicCellType.STRING);
	row.setIdentifier(DynamicCellType.STRING);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void addNewRow()
{
	DynamicGridRow row = form.dyngrdWhiteBoard().getRows().newRow();
	
	addPatientButton(row);
	
	DynamicGridCell cellLoc = row.getCells().newCell(getColumnByIdentifier(COLUMN_LOCATION), DynamicCellType.STRING);
	cellLoc.setValue("Location");
	cellLoc.setTooltip("Location");
	cellLoc.setReadOnly(true);
	
	addAssessmentsToGrid(row,form.getGlobalContext().Emergency.getWhiteBoardConfig().getAssessments());
	addFixedQuestions(row,form.getGlobalContext().Emergency.getWhiteBoardConfig());
	addConfigurableQuestions(row,form.getGlobalContext().Emergency.getWhiteBoardConfig().getOtherQuestions());
	
	if (form.getGlobalContext().Emergency.getWhiteBoardConfig().getComments())
	{
		DynamicGridCell cellComment = row.getCells().newCell(getColumnByIdentifier(COLUMN_COMMENT), DynamicCellType.IMAGEBUTTON);
   		
   		//Add Comment Button Cell
   		cellComment = row.getCells().newCell(getColumnByIdentifier(COLUMN_COMMENT), DynamicCellType.TABLE);
   		DynamicGridCellTable helper = new DynamicGridCellTable(cellComment);		
   		TableRow tableRow = helper.getRows().newRow();
   		TableCell tableCell = tableRow.getCells().newCell();
   		  		  tableCell.setType(TableCellType.BUTTON);		
   					
   		TableCellOptions cellOptions = new TableCellOptions();
   						 cellOptions.setAutopostback(true);
   						 cellOptions.setButtonImage(form.getImages().Core.Memo);
   						 cellOptions.setButtonImageText(" Comment");
   						 cellOptions.setButtonHeight(120);
   						 cellOptions.setButtonWidth(80);
   	
   		tableCell.setOptions(cellOptions);
   		cellComment.setValue(helper);
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void refreshCommentCell(SpecimenWorkListItemListVo voWorkListItemSaved, DynamicGridRow row)
{
	if(voWorkListItemSaved == null || row == null)
		return;
	DynamicGridCell commentCell = row.getCells().get(form.dyngrdCollect().getColumns().getByIdentifier(COMMENTS_COLUMN));
	if(voWorkListItemSaved.getSpecimenIsNotNull() && voWorkListItemSaved.getSpecimen().getCollectorCommentIsNotNull())
	{
		commentCell.setValue(voWorkListItemSaved.getSpecimen().getCollectorComment());
		commentCell.setTooltip(voWorkListItemSaved.getSpecimen().getCollectorComment());
	}
}
 
Example 10
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 5 votes
private void setCellTooltip(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer)
{
	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 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addGraphicQuestionRow(GraphicAssessmentQuestionVo question, PatientGraphicAssessmentQuestionAnswerVo voPatientGraphicAssessmentQuestionAnswer, boolean allowMultipleQuestion) throws PresentationLogicException
{
	checkDataIntegrity(question);

	DynamicGridColumn questionColumn = this.grid.getColumns().getByIdentifier(QUESTION_COLUMN);
	DynamicGridColumn buttonColumn = this.grid.getColumns().getByIdentifier(BUTTON_COLUMN);

	DynamicGridRow row = this.grid.getRows().newRow();

	Image rowQuestionImage = this.questionImage;
	if (question.getIsMandatoryIsNotNull() && question.getIsMandatory().booleanValue())
		rowQuestionImage = this.mandatoryQuestionImage;

	DynamicGridColumn imageColumn = this.grid.getColumns().getByIdentifier(IMAGE_COLUMN);
	if (imageColumn != null)
	{
		row.getCells().newCell(imageColumn, DynamicCellType.IMAGE).setValue(rowQuestionImage);
	}

	row.setIdentifier(question);
	row.setExpandedImage(rowQuestionImage);
	row.setCollapsedImage(rowQuestionImage);

	if (buttonColumn != null && allowMultipleQuestion)
	{
		DynamicGridCell buttonCell = row.getCells().newCell(buttonColumn, DynamicCellType.IMAGEBUTTON);
		buttonCell.setTooltip("Create new answer for this question");
		buttonCell.setValue(this.buttonAddImage);
		buttonCell.setIdentifier(BUTTON_ADD_ANSWER);
		buttonColumn.setWidth(DEFAULT_BUTTON_CELL_WIDTH);
	}

	DynamicGridCell questionCell = row.getCells().newCell(questionColumn, DynamicCellType.WRAPTEXT);
	questionCell.setValue(question.getQuestion().getShortText());
	questionCell.setTooltip(question.getQuestion().getText());
	questionCell.setReadOnly(true);

	questionCell.setIdentifier(voPatientGraphicAssessmentQuestionAnswer);

	if (question.getQuestion().getAnswerTypesIsNotNull())
	{
		for (int x = 0; x < question.getQuestion().getAnswerTypes().size(); x++)
		{
			if (question.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() && question.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue())
			{
				addAnswerCell(row, getAnswerColumn(x), question.getQuestion().getAnswerTypes().get(x), getInstAnswerType(voPatientGraphicAssessmentQuestionAnswer.getPatientAnswers(), question.getQuestion().getAnswerTypes().get(x)));
			}
		}
	}
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Function used to populate a Patient ICP Action to a row
 * @param phaseRow 
 */
protected void populateICPAction(PatientICPAction_PresentationVo action, HcpDisType discipline, DynamicGridRow phaseRow)
{
	// Check if the action matches the filter discipline
	if (action == null || (discipline != null && !action.getAction().getDiscipline().contains(discipline)))
		return;
	
	// Check for action not to be outside of the scope
	if (ICPActionStatus.NOTINSCOPE.equals(action.getCurrentStatus().getStatus()))
		return;
	
	
	// Create action row
	DynamicGridRow actionRow = phaseRow.getRows().newRow();
	
	// Set row attributes
	actionRow.setSelectable(true);
	
	actionRow.setCollapsedImage(form.getImages().ICP.Action);
	actionRow.setExpandedImage(form.getImages().ICP.Action);
	
	if (isActionEditatble(action, form.getLocalContext().getLoggedInUser()))
	{
		actionRow.setBackColor(InScopeColor);
	}
	
	// Fill in row cells
	
		// Name cell
   		DynamicGridCell cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_PRESENTATION), DynamicCellType.STRING);
   		cell.setValue(action.getAction().getName());
   		cell.setTooltip(action.getAction().getName());
   		cell.setWidth(300);
   		cell.setReadOnly(true);

   		// Requires counter-signing cell
   		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_CONTER_SIGNATURE), DynamicCellType.IMAGE);
   		if (Boolean.TRUE.equals(action.getRequiresCounterSigning()))
   		{
   			cell.setValue(form.getImages().ICP.ACTION_OUTSANDING_ENABLED_16);
   			cell.setTooltip("Requires counter-signature.");
   		}
   		cell.setWidth(25);
   		cell.setReadOnly(true);
   		
   		// Status cell
   		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.IMAGE);
   		cell.setValue(action.getCurrentStatus().getStatus().getImage());
   		cell.setTooltip(buildActionStatusTooltip(action));
   		cell.setWidth(40);
   		cell.setReadOnly(true);
   		
		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_ACTION_DETAILS), DynamicCellType.BUTTON);
   		cell.setTooltip("Action details.");
   		cell.setWidth(25);
   		cell.setAutoPostBack(true);
   		
   		// Help cell
   		if (action.getAction().getHelpURLIsNotNull() && action.getAction().getHelpURL().length() > 0)
   		{
   			cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_HELP), DynamicCellType.IMAGEBUTTON);
   			cell.setValue(form.getImages().Core.InfoEnabled16);
   			cell.setTooltip(action.getAction().getHelpURL());
   			cell.setWidth(25);
   			cell.setAutoPostBack(true);
   		}
	
	// Set row value
	actionRow.setValue(action);
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateReports(SystemReportVoCollection reports)
{
	form.dyngrdReports().getRows().clear();
	
	if (reports == null)
		return;
	
	for (SystemReportVo report : reports)
	{
		DynamicGridRow reportRow = form.dyngrdReports().getRows().newRow();
		
		reportRow.setCollapsedImage(form.getImages().Admin.Audit);
		reportRow.setExpandedImage(form.getImages().Admin.Audit);
		
		if (report.getLastDeployment() != null && report.getLastUpdated() != null
				&& report.getLastDeployment().isLessThan(report.getLastUpdated()))
		{
			reportRow.setTextColor(Color.Black);
		}
		else
		{
			reportRow.setTextColor(Color.Gray);
		}

		DynamicGridCell cellName = reportRow.getCells().newCell(form.dyngrdReports().getColumns().getByIdentifier(COL_NAME), DynamicCellType.STRING);
		cellName.setValue("<b>" + report.getReportName() + "</b>");
		cellName.setReadOnly(true);
		cellName.setTooltip(getReportTemplate(report.getReportXml()));
		
		DynamicGridCell cellLastDeployed = reportRow.getCells().newCell(form.dyngrdReports().getColumns().getByIdentifier(COL_LAST_DEPLOY), DynamicCellType.DATETIME);
		cellLastDeployed.setValue(report.getLastDeployment());
		cellLastDeployed.setReadOnly(true);
		
		DynamicGridCell cellLastModified = reportRow.getCells().newCell(form.dyngrdReports().getColumns().getByIdentifier(COL_LAST_MODIFY), DynamicCellType.DATETIME);
		cellLastModified.setValue(report.getLastUpdated());
		cellLastModified.setReadOnly(true);
		
		reportRow.setValue(report);
		
		if (report.getTemplates() != null)
			populateTemplates(reportRow, report.getTemplates());
		
		reportRow.setExpanded(true);
	}
}
 
Example 14
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 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Function used to populate a Patient ICP Phase to a row
 */
protected void populateICPPhase(PatientICPPhase_PresentationVo phase, HcpDisType discipline, DynamicGridRow stageRow)
{
	// Check if phase not to be outside of scope
	if (phase == null || ICPPhaseStatus.NOTINSCOPE.equals(phase.getCurrentStatus().getStatus()))
		return;
	
	// Create phase row
	DynamicGridRow phaseRow = stageRow.getRows().newRow();
	
	// Set row attributes
	phaseRow.setSelectable(true);
	
	phaseRow.setCollapsedImage(form.getImages().ICP.Phase);
	phaseRow.setExpandedImage(form.getImages().ICP.Phase);
	
	// Fill in row cells
	DynamicGridCell cell = phaseRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_PRESENTATION), DynamicCellType.STRING);
	cell.setValue(phase.getPhase().getName());
	cell.setWidth(300);
	cell.setReadOnly(true);
	
   		// If phase has goals defined then display them as a tooltip
   		if (phase.getPhase().getGoalsIsNotNull() && phase.getPhase().getGoals().size() > 0)
   		{
   			cell.setTooltip(buildPhaseGoalsString(phase));
   		}
	
	if (phase.getPhase().getHelpURLIsNotNull() && phase.getPhase().getHelpURL().length() > 0)
	{
		cell = phaseRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_HELP), DynamicCellType.IMAGEBUTTON);
		cell.setValue(form.getImages().Core.InfoEnabled16);
		cell.setTooltip(phase.getPhase().getHelpURL());
		cell.setWidth(25);
		cell.setAutoPostBack(true);
	}
	
	// Set row value
	phaseRow.setValue(phase);
	
	
	if (phase.getActions() == null)
		return;
	
	phase.getActions().sort(new ActionsComparator());
	
	// Populate phase's Patient ICP Actions
	for (PatientICPAction_PresentationVo action : phase.getActions())
	{
		populateICPAction(action, discipline, phaseRow);
	}
	
	// Expand phase row
	phaseRow.setExpanded(true);
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateDetailsGrid(PatientAssessmentVo voPatAss, Integer score)
{
	super.populateScreenFromData(voPatAss);
	form.dynGridDetails().getRows().clear();
	
	if(voPatAss == null)
		return;

	populateAuthoringInfoControls(voPatAss);

	int questionIndex = 1;
	for (int i = 0; i < voPatAss.getAssessmentData().getAnswerGroups().size(); i++)
	{
		PatientAssessmentGroupVo voPatAssessGroup = voPatAss.getAssessmentData().getAnswerGroups().get(i);
		if(voPatAssessGroup.getAssessmentAnswers() != null)
			voPatAssessGroup.getAssessmentAnswers().sort();
		for (int j = 0; j < voPatAssessGroup.getAssessmentAnswers().size(); j++)
		{
			PatientAssessmentQuestionVo voPatAssQuestion = voPatAssessGroup.getAssessmentAnswers().get(j);
			if(isStatusAnswered(voPatAssQuestion) && hasAnswers(voPatAssQuestion))
			{
				ScoreAndImage scoreImage = getHelper().getScoreImage(voPatAssQuestion);
				if(!isNotTheSameScoreRecord(score, scoreImage))
					continue;
				
				DynamicGridRow row = form.dynGridDetails().getRows().newRow();
				
				DynamicGridCell imageCell = row.getCells().newCell(getCellByIdentifier(IMAGE_COLUMN), DynamicCellType.IMAGE);
				if(scoreImage != null)
				{
					imageCell.setValue(scoreImage.getImage());
				}
				String text = getQuestionText(voPatAssQuestion, questionIndex);
				questionIndex++;
				
				DynamicGridCell assessmentCell = row.getCells().newCell(getCellByIdentifier(ASSESSMENT_COLUMN), DynamicCellType.WRAPTEXT);
				assessmentCell.setValue(text);
				assessmentCell.setTooltip(text);
				assessmentCell.setReadOnly(true);
				//TODO - try to set it bold
				//assessmentCell.setBold
				
				DynamicGridCell protocolCell = row.getCells().newCell(getCellByIdentifier(PROTOCOL_COLUMN), DynamicCellType.STRING);
				protocolCell.setValue(voPatAssQuestion.getAssessmentQuestion().getProtocol());
				protocolCell.setTooltip(voPatAssQuestion.getAssessmentQuestion().getProtocol());
				protocolCell.setReadOnly(true);
				
				DynamicGridCell initialsCell = row.getCells().newCell(getCellByIdentifier(INITIALS_COLUMN), DynamicCellType.STRING);
				initialsCell.setValue(getInitials(voPatAssQuestion));
				initialsCell.setTooltip(getInitialsTooltip(voPatAssQuestion));
				initialsCell.setReadOnly(true);
				
				String urlText = getUrlText(voPatAssQuestion);
				if(urlText != null && urlText.length() > 0)
				{
					DynamicGridCell urlCell = row.getCells().newCell(getCellByIdentifier(URL_COLUMN), DynamicCellType.IMAGEBUTTON);
					urlCell.setValue(form.getImages().Core.Information);
					urlCell.setTooltip(getUrlText(voPatAssQuestion));
					urlCell.setReadOnly(false);
				}
		
				if(voPatAssQuestion.getIsPocIsNotNull() && voPatAssQuestion.getIsPoc().booleanValue())
					row.setBackColor(Color.Beige);
				
				row.setValue(voPatAssQuestion);
			}
		}
	}
}
 
Example 17
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private void addGraphicQuestionRow(GraphicAssessmentQuestionVo question, PatientGraphicAssessmentQuestionAnswerVo voPatientGraphicAssessmentQuestionAnswer, boolean allowMultipleQuestion) throws PresentationLogicException 
{
	checkDataIntegrity(question);
	
	addGraphicQuestionLegend(question.getQuestion().getLegendText());
	
	DynamicGridColumn questionColumn = this.grid.getColumns().getByIdentifier(QUESTION_COLUMN);
	DynamicGridColumn buttonColumn = this.grid.getColumns().getByIdentifier(BUTTON_COLUMN);

	DynamicGridRow row = this.grid.getRows().newRow();
	
	Image rowQuestionImage = this.questionImage;
	if(question.getIsMandatoryIsNotNull() && question.getIsMandatory().booleanValue())
		rowQuestionImage = this.mandatoryQuestionImage;
	
	DynamicGridColumn imageColumn = this.grid.getColumns().getByIdentifier(IMAGE_COLUMN);
	if(imageColumn != null)
	{
		row.getCells().newCell(imageColumn, DynamicCellType.IMAGE).setValue(rowQuestionImage);				
	}
	
	row.setIdentifier(question);
	row.setExpandedImage(rowQuestionImage);
	row.setCollapsedImage(rowQuestionImage);
	
	if(buttonColumn != null && allowMultipleQuestion)
	{
		DynamicGridCell buttonCell = row.getCells().newCell(buttonColumn, DynamicCellType.IMAGEBUTTON);			
		buttonCell.setTooltip("Create new answer for this question");
		buttonCell.setValue(this.buttonAddImage);
		buttonCell.setIdentifier(BUTTON_ADD_ANSWER);			
		buttonColumn.setWidth(DEFAULT_BUTTON_CELL_WIDTH);
	}

	DynamicGridCell questionCell = row.getCells().newCell(questionColumn, DynamicCellType.WRAPTEXT);		
	questionCell.setValue(question.getQuestion().getShortText());
	questionCell.setTooltip(question.getQuestion().getText());			
	questionCell.setReadOnly(true);	
	
	questionCell.setIdentifier(voPatientGraphicAssessmentQuestionAnswer);
	
	if(question.getQuestion().getAnswerTypesIsNotNull())
	{
		for(int x = 0; x < question.getQuestion().getAnswerTypes().size(); x++)
		{
			if(question.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() 
					&& question.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue())
			{
				addAnswerCell(row, getAnswerColumn(x), question.getQuestion().getAnswerTypes().get(x), getInstAnswerType(voPatientGraphicAssessmentQuestionAnswer.getPatientAnswers(), question.getQuestion().getAnswerTypes().get(x)));
			}
		}
	}
}
 
Example 18
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private void addGraphicQuestionRow(GraphicAssessmentFindingQuestionVo question, PatientGraphicAssessmentFindingQuestionAnswerVo voPatientGraphicAssessmentFindingQuestionAnswer, boolean allowMultipleQuestion)  throws PresentationLogicException
{
	DynamicGridColumn questionColumn = this.grid.getColumns().getByIdentifier(QUESTION_COLUMN);
	DynamicGridColumn buttonColumn = this.grid.getColumns().getByIdentifier(BUTTON_COLUMN);

	checkDataIntegrity(question);
	
	addGraphicQuestionLegend(question.getQuestion().getLegendText());
	
	DynamicGridRow row = this.grid.getRows().newRow();
	
	Image rowQuestionImage = this.questionImage;
	if(question.getIsMandatoryIsNotNull() && question.getIsMandatory().booleanValue())
		rowQuestionImage = this.mandatoryQuestionImage;
	
	DynamicGridColumn imageColumn = this.grid.getColumns().getByIdentifier(IMAGE_COLUMN);
	if(imageColumn != null)
	{
		row.getCells().newCell(imageColumn, DynamicCellType.IMAGE).setValue(rowQuestionImage);				
	}
	
	row.setIdentifier(question);
	row.setExpandedImage(rowQuestionImage);
	row.setCollapsedImage(rowQuestionImage);
	
	if(buttonColumn != null && allowMultipleQuestion)
	{
		DynamicGridCell buttonCell = row.getCells().newCell(buttonColumn, DynamicCellType.IMAGEBUTTON);			
		buttonCell.setTooltip("Create new answer for this question");
		buttonCell.setValue(this.buttonAddImage);
		buttonCell.setIdentifier(BUTTON_ADD_ANSWER);			
		buttonColumn.setWidth(DEFAULT_BUTTON_CELL_WIDTH);
	}

	DynamicGridCell questionCell = row.getCells().newCell(questionColumn, DynamicCellType.WRAPTEXT);		
	questionCell.setValue(question.getQuestion().getShortText());
	questionCell.setTooltip(question.getQuestion().getText());			
	questionCell.setReadOnly(true);	
	
	questionCell.setIdentifier(voPatientGraphicAssessmentFindingQuestionAnswer);
	
	if(question.getQuestion().getAnswerTypesIsNotNull())
	{
		for(int x = 0; x < question.getQuestion().getAnswerTypes().size(); x++)
		{
			if(question.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() 
				&& question.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue())
			{
				addAnswerCell(row, getAnswerColumn(x), question.getQuestion().getAnswerTypes().get(x), getInstAnswerType(voPatientGraphicAssessmentFindingQuestionAnswer.getPatientAnswers(), question.getQuestion().getAnswerTypes().get(x)));
			}
		}
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addChildRow(TTAMedicationDetailForTTAHistoryVo detail, DynamicGridRow parent)
{
	if (detail == null || parent == null)
		return;
	DynamicGridRow child = parent.getRows().newRow();
	child.setValue(detail);

	if (detail.getMedicationIsNotNull() && detail.getMedication().getIsControlledDrugIsNotNull() && detail.getMedication().getIsControlledDrug())
		child.setBackColor(ConfigFlag.UI.CONTROLLED_DRUG_COLOR.getValue());

	DynamicGridCell cell = child.getCells().newCell(getGridColumn(NAME_IDENTIFIER), DynamicCellType.STRING);
	cell.setValue(detail.getOtherMedicationTextIsNotNull() ? detail.getOtherMedicationText() : null); //WDEV-14407
	//cell.setValue(detail.getMedicationIsNotNull() ? detail.getMedication().getMedicationName() : null);
	if (detail.getOtherMedicationTextIsNotNull())
	{
		cell.setTooltip(detail.getOtherMedicationText());
	}
	cell.setReadOnly(true);
	cell = child.getCells().newCell(getGridColumn(DOSE_IDENTIFIER), DynamicCellType.STRING);
	String detailS = "";
	if (detail.getDoseValueIsNotNull())
	{
		detailS += formatFloat(detail.getDoseValue());	//	WDEV-13073
		if (detail.getDoseUnitIsNotNull())
		{
			detailS += " " + detail.getDoseUnit().getText();
		}
		else
		if (detail.getUnitTextIsNotNull())
		{
			detailS += " " + detail.getUnitText();
		}
	}
	cell.setReadOnly(true);
	cell.setValue(detailS);

	cell = child.getCells().newCell(getGridColumn(ROUTE_IDENTIFIER), DynamicCellType.STRING);
	cell.setValue(detail.getRouteIsNotNull() ? detail.getRoute().getText() : null);
	cell.setReadOnly(true);
	cell = child.getCells().newCell(getGridColumn(FREQUENCY_IDENTIFIER), DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setValue(detail.getFrequencyUnitIsNotNull()?detail.getFrequencyUnit().getText():null);
	cell = child.getCells().newCell(getGridColumn(FORM_IDENTIFIER), DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setValue(detail.getFormIsNotNull() ? detail.getForm().getText() : null);
	cell = child.getCells().newCell(getGridColumn(SELECT_IDENTIFIER), DynamicCellType.BOOL);
	cell.setAutoPostBack(true);
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateDepartmentsGrid(LocationDepartmentTypesVo locationDepartmentTypes) 
{
	form.dyngrdDepartments().getRows().clear();
	
	if(FormMode.EDIT.equals(form.getMode()))
	{
		populateDepartmentsGridWithDefault();
	}
	
	if(locationDepartmentTypes == null || locationDepartmentTypes.getDepartmentTypes() == null)
		return;
	
	for(int i=0; i<locationDepartmentTypes.getDepartmentTypes().size(); i++)
	{
		if(locationDepartmentTypes.getDepartmentTypes().get(i) == null)
			continue;
		
		DynamicGridRow row = getRowByDepartment(locationDepartmentTypes.getDepartmentTypes().get(i));
		
		if(row == null)
			row = form.dyngrdDepartments().getRows().newRow();
		
		DynamicGridCell cell = row.getCells().newCell(getSelectedColumn(COLDEPARTMENT), DynamicCellType.LABEL);
		cell.setValue(locationDepartmentTypes.getDepartmentTypes().get(i).getText());
		cell.setTooltip(locationDepartmentTypes.getDepartmentTypes().get(i).getText());
		cell.setReadOnly(true);
		
		cell = row.getCells().newCell(getSelectedColumn(COLSELECTED), DynamicCellType.BOOL);
		cell.setAutoPostBack(true);
		cell.setValue(true);
		
		cell = row.getCells().newCell(getSelectedColumn(COLDEFAULT), DynamicCellType.BOOL);
		cell.setAutoPostBack(true);
		
		if(locationDepartmentTypes.getDepartmentTypes().get(i).equals(locationDepartmentTypes.getDefaultDepartmentType()))
		{
			cell.setValue(true);
		}
		
		row.setValue(locationDepartmentTypes.getDepartmentTypes().get(i));
	}
}