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

The following are Jave code examples for showing how to use setBackColor() 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 ListAwaitingClinicalImagingResult(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(200);
	cell.setValue("Awaiting Clinical Imaging Result");
	cell.setBackColor(Color.fromRGB(198, 223, 242));				
	
	for(int i=0;i< areas.size();i++)
	{			
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		//String val="";
		cell.setValue("-");
		//cell.setBackColor(Color.LightSteelBlue);			
	}
	
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>-</B>");
	cell.setBackColor(Color.Bisque);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void ListAwaitingPathologyResult(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue("Awaiting Pathology Result");
	cell.setBackColor(Color.fromRGB(198, 223, 242));

	for(int i=0;i< areas.size();i++)
	{			
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		//String val="";
		cell.setValue("-");
		//cell.setBackColor(Color.LightSteelBlue);			
	}
	
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>-</B>");
	cell.setBackColor(Color.Bisque);
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
/**
 * WDEV-12907
 * Function used to populate Over45 field
 * @param required
 * @param isOver45 - value to be set; if it is <b>null</b> then it will default accordingly to patient age (Yes when age is over 45, No when age is at most 45)
 */
private void populateOver45(Boolean required, Boolean isOver45)
{
	YesNoCollection lookup = ims.core.vo.lookups.LookupHelper.getYesNo(this.domain.getLookupService());

	DynamicGridRow over45Row = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabTNM().dynGrdPreTreatment().getRows().newRow();
	DynamicGridCell typeNameCell = over45Row.getCells().newCell(getColumn(COLTYPE_NAME), DynamicCellType.HTMLVIEW);
	typeNameCell.setBackColor(Color.Gray);
	typeNameCell.setOptions(DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	typeNameCell.setValue("<b><p align=center>Over 45</p></b>");

	DynamicGridCell typeValueCell = over45Row.getCells().newCell(getColumn(COLTYPE_VALUE), DynamicCellType.ENUMERATION);
	for (int i = 0; i < lookup.size(); i++)
	{
		typeValueCell.getItems().newItem(lookup.get(i), lookup.get(i).getText());
	}

	if (Boolean.TRUE.equals(required))
	{
		if (isOver45 != null)
		{
			typeValueCell.setValue(Boolean.TRUE.equals(isOver45) ? YesNo.YES : YesNo.NO);
		}
		else
		{
			if (form.getGlobalContext().Core.getPatientShort().getAgeIsNotNull())
			{
				typeValueCell.setValue(form.getGlobalContext().Core.getPatientShort().getAge().intValue() >= 45 ? YesNo.YES : YesNo.NO);
			}
		}
	}

	typeValueCell.setAutoPostBack(true);
	typeValueCell.setIdentifier(OVER45);
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void populateOverall(TumourGroupSiteOverallStagingVo value)
{
	DynamicGridRow overallRow = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabTNM().dynGrdPreTreatment().getRows().newRow();
	overallRow.setIdentifier(OVERALL_VALUE);
	DynamicGridCell typeNameCell = overallRow.getCells().newCell(getColumn(COLTYPE_NAME), DynamicCellType.HTMLVIEW);
	typeNameCell.setBackColor(Color.Gray);
	typeNameCell.setOptions(DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	typeNameCell.setValue("<b><p align=center>Overall Stage</p></b>");

	DynamicGridCell typeValueCell = overallRow.getCells().newCell(getColumn(COLTYPE_VALUE), DynamicCellType.ENUMERATION);
	if (value != null)
		typeValueCell.setIdentifier(value);
	else
		typeValueCell.setIdentifier(OVERALL_VALUE);

	typeValueCell.setAutoPostBack(true);
	if (value != null)
	{
		typeValueCell.getItems().newItem(value, value.toString());
		typeValueCell.setValue(value);
	}

	TNMCertaintyFactorCollection certaintyFactor = ims.oncology.vo.lookups.LookupHelper.getTNMCertaintyFactor(this.domain.getLookupService());

	DynamicGridCell certainNameCell = overallRow.getCells().newCell(getColumn(COLCERTAIN_NAME), DynamicCellType.HTMLVIEW);
	certainNameCell.setBackColor(Color.Gray);
	certainNameCell.setOptions(DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	certainNameCell.setValue("<b><p align=center>Overall Certainty</p></b>");

	DynamicGridCell certainValueCell = overallRow.getCells().newCell(getColumn(COLCERTAIN_VALUE), DynamicCellType.ENUMERATION);
	certainValueCell.setIdentifier(OVERALLCERTAIN_VALUE);
	bindCertaintyFactor(certaintyFactor, certainValueCell, form.getLocalContext().getSelectedRecordIsNotNull() && form.getLocalContext().getSelectedRecord().getID_PrimaryTumourDetailsIsNotNull() ? (form.getLocalContext().getSelectedRecord().getPreTreatmentOverAllCertIsNotNull() ? form.getLocalContext().getSelectedRecord().getPreTreatmentOverAllCert() : null) : null);
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void checkIfThereAreModificationInParent(DynamicGridRow parent) 
{
	if(parent == null || parent.getRows() == null)
		return;
	
	boolean areModification = false;
	
	for(int i=0; i<parent.getRows().size(); i++)
	{
		DynamicGridCell cell = parent.getRows().get(i).getCells().get(getColumn(COL_WAS_MODIFIED));
		
		if(cell != null && Boolean.TRUE.equals(cell.getValue()))
			areModification = true;
	}
	
	DynamicGridCell parentCell = parent.getCells().get(getColumn(COL_WAS_MODIFIED));
	
	if(parentCell == null)
		parentCell = parent.getCells().newCell(getColumn(COL_WAS_MODIFIED), DynamicCellType.BOOL);
	
	parentCell.setValue(areModification);
	
	if(Boolean.FALSE.equals(areModification))
	{
		DynamicGridCell resultCell = parent.getCells().get(getColumn(COL_RESULT_DATA));
		if(resultCell != null)
			resultCell.setBackColor(null);
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void ListAwaitingTriageCounts(TrackingAreaVoCollection areas, ILocation currentLocation)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();		
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(140);
	cell.setValue("Awaiting Triage");
	cell.setBackColor(Color.fromRGB(198, 223, 242));
	
	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getAwaitingTriageCounts(currentLocation, areas.get(i));								
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");
	cell.setBackColor(Color.Bisque);
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void ListPrioritiesCounts(ILocation currentLocation,TrackingAreaVoCollection areas, String priority, TriagePriority lookup_inst_id)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue(priority);
	cell.setBackColor(Color.fromRGB(198, 223, 242));
	
	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getPriorityXCounts(currentLocation, areas.get(i),lookup_inst_id);
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
			
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");
	cell.setBackColor(Color.Bisque);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void ListUnallocated(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue("Unallocated");
	cell.setBackColor(Color.fromRGB(198, 223, 242));
	
	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getUnallocated(currentLocation, areas.get(i));
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");
	cell.setBackColor(Color.Bisque);
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void ListAllocated(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue("Allocated");
	cell.setBackColor(Color.fromRGB(198, 223, 242));
	
	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{			
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getAllocated(currentLocation, areas.get(i));
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");
	cell.setBackColor(Color.Bisque);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void ListReferredToSpecialty(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue("Referred to Specialty");
	cell.setBackColor(Color.fromRGB(198, 223, 242));
	
	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{			
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getReferredToSpecialty(currentLocation, areas.get(i));
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
	
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");		
	cell.setBackColor(Color.Bisque);
	
	
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void newNote(DynamicGridRow row, TltSummaryNoteVo note, boolean isEditMode) 
{			
	if (row == null) {
		throw new CodingRuntimeException("DynamicGridRow is null");
	}
	
	if (note == null) {
		row.setIdentifier(NEW_ROW_IDENTIFIER);
	}
	
	DynamicGridColumn 	coll;
	DynamicGridCell 	cell;
			
	coll = form.dyngrdNotes().getColumns().getByIdentifier(COL_DATE);
	cell = row.getCells().newCell(coll, DynamicCellType.DATETIME);		
	cell.setValue(note != null ? (note.getAuthoringInformationIsNotNull() ? note.getAuthoringInformation().getAuthoringDateTime() : new DateTime())  : new DateTime());				
	cell.setBackColor(Color.fromRGB(224, 224, 224));		
	cell.setReadOnly(true);
	
	coll = form.dyngrdNotes().getColumns().getByIdentifier(COL_USER);
	cell = row.getCells().newCell(coll, DynamicCellType.STRING);		
	cell.setValue(note != null ? (note.getAuthoringInformationIsNotNull() ? (note.getAuthoringInformation().getAuthoringHcpIsNotNull() ? (note.getAuthoringInformation().getAuthoringHcp().getName() != null ? note.getAuthoringInformation().getAuthoringHcp().getName().toString() : null) : null ) : null)  : domain.getHcpLiteUser() != null ? ((HcpLiteVo)domain.getHcpLiteUser()).getName() != null ? ((HcpLiteVo)domain.getHcpLiteUser()).getName().toString() : null : null);		
	cell.setBackColor(Color.fromRGB(224, 224, 224));
	cell.setReadOnly(true);
			
	coll = form.dyngrdNotes().getColumns().getByIdentifier(COL_NOTES);		
	cell = row.getCells().newCell(coll, DynamicCellType.WRAPTEXT);						
	cell.setValue(note != null ? note.getSummaryNote() : null);
	cell.setDecoratorType(DynamicCellDecoratorMode.NEVER);	
	cell.setReadOnly(isEditMode ? false : true);
	cell.setBackColor(isEditMode ? Color.White : Color.fromRGB(224, 224, 224));
	cell.setReadOnly(!isEditMode);		
	cell.setStringMaxLength(3000);
	
	row.setValue(note);		
	
	if (isEditMode) {
		form.getLocalContext().setEditedNote(note);
	}			
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void ListLOSBreached(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue("LOS Breached");
	cell.setBackColor(Color.fromRGB(198, 223, 242));

	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{			
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getLOSBreached(currentLocation, areas.get(i));
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
	
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");
	cell.setBackColor(Color.Bisque);
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void ListAverageLengthOfStay(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue("Average Length of Stay");
	cell.setBackColor(Color.fromRGB(198, 223, 242));

	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{			
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getAverageLengthOfStay(currentLocation, areas.get(i));
		if(val!=null)
		{
			String time_val=get_h_m_s(val);
			if(!time_val.equals("0"))
			{
				cell.setValue(time_val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
				
	}
	
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);		
	cell.setValue("<b>"+(overall_sum>0?get_h_m_s(String.valueOf(overall_sum)):"-")+"<b>");
	//cell.setValue("-");
	cell.setBackColor(Color.Bisque);
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * WDEV-12627
 * Function used to populate values & comments to grid
 * It will add the columns as it needs it for values and comments. It will attempt to 
 * @param tooltip 
 */
private void populateValue(IChartValueSet set, IChartValueGroup group, IChartValue value, int valueIndex, int groupIndex, StringBuffer tooltip)// 	WDEV-16395 
{
	if(group == null || value == null)
		return;
	
	boolean isAbnormal = value.getIChartValueIsAbnormal() != null && value.getIChartValueIsAbnormal().booleanValue();
	
	//WDEV-12547
	if(form.getLocalContext().getViewingStyleIsNotNull() && form.getLocalContext().getViewingStyle().equals(VIEW_GRAPHICAL))
	{
		if(isSelected(group))
		{
			if (value.getIChartValueValue() != null)
			{
				getGraphing().addPoint(new GraphingCustomOneValue(graphingGroups.get(group), value.getIChartValueDateTime(), normalizeValue(set, group, value), value, buildValueTooltip(group, value)));
			}
		}
	}
	
	DynamicGridRow row = getGroupRow(group);

	// Find a column based on the identifier created (the equals method in ColumnIdentifierValue class is overwritten with custom code)
	// If no column exists then a new one is created
	DynamicGridColumn valueColumn = getValueColumn(value.getIChartValueDateTime(), groupIndex, value.getIChartValueLabSpecimen(), value.getIChartValueOrderSpecimen());//WDEV-12627, WDEV-12628
	
	DynamicGridCell cell = row.getCells().newCell(valueColumn, DynamicCellType.STRING);
	StringBuilder valueTooltip = new StringBuilder();
	if (value.getIChartValueValue() != null)
	{
		cell.setValue(value.getIChartValueValue().toString());
		valueTooltip.append(value.getIChartValueValue().toString()).append("<br>");
	}
	else
	{
		cell.setValue(value.getIChartValue().substring(0, Math.min(value.getIChartValue().length(), CHARS_TO_TRIM_ST_RESULTS)));
		valueTooltip.append(value.getIChartValue()).append("<br>");
	}
	
	cell.setReadOnly(true);

	// Find a column based on the identifier created (the equals method in ColumnIdentifierComments class is overwritten with custom code)
	DynamicGridColumn commentColumn = getCommentColumn(valueColumn);//WDEV-12627, WDEV-12628
		
	if ((value.getIChartValueComments() != null && value.getIChartValueComments().length > 0)
			|| Boolean.TRUE.equals(ConfigFlag.UI.DISPLAY_INVESTIGATION_COMMENTS_ON_CUMULATE_RESULTS.getValue()) && (value.getIChartValueInvestigationComments() != null && value.getIChartValueInvestigationComments().length > 0)
			|| Boolean.TRUE.equals(ConfigFlag.UI.DISPLAY_INVESTIGATION_COMMENTS_ON_CUMULATE_RESULTS.getValue()) && (value.getIChartValueSpecimenComments() != null && value.getIChartValueSpecimenComments().length > 0))
	{
		DynamicGridCell commentCell = row.getCells().newCell(commentColumn, DynamicCellType.BUTTON);			
		commentCell.setIdentifier(value);
		commentCell.setReadOnly(true);
	}
	
	if(isAbnormal)
	{
		DynamicGridCell nameCell = row.getCells().get(getGrid().getColumns().getByIdentifier(COLUMN_NAME));
		nameCell.setTextColor(CELL_ABNORMAL_TEXTCOLOR);
		nameCell.setBackColor(CELL_ABNORMAL_BACKCOLOR);
		cell.setTextColor(CELL_ABNORMAL_TEXTCOLOR);
		cell.setBackColor(CELL_ABNORMAL_BACKCOLOR);			
	}
	
	cell.setIdentifier(value);

	valueTooltip.append(tooltip.toString());
	valueTooltip.append("<br><b>Units:</b> ").append(value.getIChartValueUnitOfMeasure() != null ? value.getIChartValueUnitOfMeasure() : "-");
	valueTooltip.append("<br><b>Ref. Range:</b> ").append(value.getIChartValueRefRange() != null ? value.getIChartValueRefRange() : "-");
	cell.setTooltip(valueTooltip.toString());
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateAddressCells(DynamicGridCell cell,	PersonAddress address, boolean isFromSource) 
{
	if(cell == null)
		return;
	
	for(int i=0; i<cell.getRow().getRows().size(); i++)
	{
		DynamicGridRow row = cell.getRow().getRows().get(i);
		Object rowValue = cell.getRow().getRows().get(i).getValue();
		
		DynamicGridCell resultCell = row.getCells().newCell(getColumn(COL_RESULT_DATA), DynamicCellType.STRING);
		resultCell.setReadOnly(true);
		
		if(PatientMergeFields.ADDRESSLINE1.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getLine1() : null );
		}
		else if(PatientMergeFields.ADDRESSLINE2.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getLine2() : null);
		}
		else if(PatientMergeFields.ADDRESSLINE3.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getLine3() : null);
		}
		else if(PatientMergeFields.ADDRESSLINE4.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getLine4() : null);
		}
		else if(PatientMergeFields.ADDRESSLINE5.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getLine5() : null);
		}
		else if(PatientMergeFields.POSTCODE.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getPostCode() : null);
		}
		else if(PatientMergeFields.PHONE.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getPhone() : null);
		}
		else if(PatientMergeFields.FAX.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getFax() : null);
		}
		else if(PatientMergeFields.ADDRESSTYPE.equals(rowValue))
		{
			resultCell.setValue((address != null && address.getAddressType() != null) ? address.getAddressType().getText() : null);
		}
		else if(PatientMergeFields.CCG.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getPCT() : null);
		}
		else if(PatientMergeFields.OTHERPHONE.equals(rowValue))
		{
			resultCell.setValue(address != null ? address.getOtherphone() : null);
		}
		
		resultCell.setBackColor(isFromSource ? Color.Beige : null);
		
		DynamicGridCell wasDestinationModified = row.getCells().get(getColumn(COL_WAS_MODIFIED));
		if(wasDestinationModified == null)
			wasDestinationModified = row.getCells().newCell(getColumn(COL_WAS_MODIFIED), DynamicCellType.BOOL);
		
		wasDestinationModified.setValue(isFromSource ? Boolean.TRUE : Boolean.FALSE);
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateNameCells(DynamicGridCell cell, PersonName name, boolean isFromSource) 
{
	if(cell == null)
		return;
	
	for(int i=0; i<cell.getRow().getRows().size(); i++)
	{
		DynamicGridRow row = cell.getRow().getRows().get(i);
		Object rowValue = row.getValue();
		
		DynamicGridCell resultCell = row.getCells().newCell(getColumn(COL_RESULT_DATA), DynamicCellType.STRING);
		resultCell.setReadOnly(true);
		
		if(PatientMergeFields.TITLE.equals(rowValue))
		{
			resultCell.setValue((name != null && name.getTitle() != null) ? name.getTitle().toString() : null);
		}
		else if(PatientMergeFields.SURNAME.equals(rowValue))
		{
			resultCell.setValue(name != null ? name.getSurname() : null);
		}
		else if(PatientMergeFields.FORENAME.equals(rowValue))
		{
			resultCell.setValue(name != null ? name.getForename() : null);
		}
		else if(PatientMergeFields.MIDDLENAME.equals(rowValue))
		{
			resultCell.setValue(name != null ? name.getMiddleName() : null);
		}
		
		resultCell.setBackColor(isFromSource && !sourceIsEqualWithDestination(row) ? Color.Beige : null);
		
		if(!sourceIsEqualWithDestination(row))
		{
			DynamicGridCell wasDestinationModified = row.getCells().get(getColumn(COL_WAS_MODIFIED));
			if(wasDestinationModified == null)
				wasDestinationModified = row.getCells().newCell(getColumn(COL_WAS_MODIFIED), DynamicCellType.BOOL);
		
			wasDestinationModified.setValue(isFromSource ? Boolean.TRUE : Boolean.FALSE);
		}
	}
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateResultChannelCell(DynamicGridCell cell, boolean isFromSource, PatientMergeVo patient, DynamicGridCell newCell) 
{
	if(cell == null)
		return;
	
	Object rowValue = cell.getRow().getValue();
	Patient result = form.getLocalContext().getResultPatient();
	
	Object commChannelValue = null;
	
	DynamicGridCell commChannelValueCell = isFromSource ? cell.getRow().getCells().get(getColumn(COL_SOURCE_PATIENT)) : cell.getRow().getCells().get(getColumn(COL_DESTINATION_PATIENT));
	DynamicGridCell previousCommChannelValueCell = isFromSource ? cell.getRow().getCells().get(getColumn(COL_DESTINATION_PATIENT)) : cell.getRow().getCells().get(getColumn(COL_SOURCE_PATIENT));
	
	if(commChannelValueCell != null)
		commChannelValue = commChannelValueCell.getValue();
	
	CommChannelVo channel = getCommChannel((ChannelType) rowValue, commChannelValue, patient.getCommChannels());
	CommChannelVo previousChannel = null;
	
	if(previousCommChannelValueCell != null)
	{
		previousChannel = getCommChannel((ChannelType) rowValue, previousCommChannelValueCell.getValue(), result.getCommChannels());
	}
	
	newCell.setValue(channel != null ? channel.getCommValue() : null);
	
	if(channel != null)
	{
		if(result.getCommChannels() == null)
			result.setCommChannels(new CommChannelVoCollection());
		
		result.getCommChannels().add(channel);
	}
	
	if(previousChannel != null)
		result.getCommChannels().remove(previousChannel);
	
	newCell.setBackColor(isFromSource && !sourceIsEqualWithDestination(cell.getRow()) ? Color.Beige : null);
	
	if(!sourceIsEqualWithDestination(cell.getRow()))
	{
		DynamicGridCell wasDestinationModified = cell.getRow().getCells().get(getColumn(COL_WAS_MODIFIED));
		if(wasDestinationModified == null)
			wasDestinationModified = cell.getRow().getCells().newCell(getColumn(COL_WAS_MODIFIED), DynamicCellType.BOOL);
		
		wasDestinationModified.setValue(isFromSource ? Boolean.TRUE : Boolean.FALSE);
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
@Override
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException 
{
	if(form.getLocalContext().getMessageBoxIdFromGPAndGPSurgery() != null && messageBoxId == form.getLocalContext().getMessageBoxIdFromGPAndGPSurgery())
	{
		if(DialogResult.YES.equals(result))
		{
			form.getLocalContext().getResultPatient().setGp(form.getLocalContext().getNewGP() != null ? new GpShortVo(form.getLocalContext().getNewGP().getID_Gp(), form.getLocalContext().getNewGP().getVersion_Gp()) : null);
			form.getLocalContext().getResultPatient().setGpSurgery(form.getLocalContext().getNewGPSurgery() != null ? new LocSiteShortVo(form.getLocalContext().getNewGPSurgery().getID_Location(), form.getLocalContext().getNewGPSurgery().getVersion_Location()) : null);
			
			for(int i=0; i<form.dyngrdMerge().getRows().size(); i++)
			{
				DynamicGridCell cell = null;
				
				if(PatientMergeFields.GP.equals(form.dyngrdMerge().getRows().get(i).getValue()) || PatientMergeFields.GP_SURGERY.equals(form.dyngrdMerge().getRows().get(i).getValue()))
				{
					cell = form.dyngrdMerge().getRows().get(i).getCells().get(getColumn(COL_RESULT_DATA));
					if(cell == null)
						cell = form.dyngrdMerge().getRows().get(i).getCells().newCell(getColumn(COL_RESULT_DATA), DynamicCellType.STRING);
					
					if(PatientMergeFields.GP.equals(form.dyngrdMerge().getRows().get(i).getValue()))
					{
						cell.setValue(form.getLocalContext().getNewGP() != null ? form.getLocalContext().getNewGP().getName().toString() : null);
					}
					else if(PatientMergeFields.GP_SURGERY.equals(form.dyngrdMerge().getRows().get(i).getValue()))
					{
						cell.setValue(form.getLocalContext().getNewGPSurgery() != null ? form.getLocalContext().getNewGPSurgery().getName() : null);
					}
					
					cell.setBackColor(form.getLocalContext().getCellColor());
				}
			}
		}
		
		form.getLocalContext().setMessageBoxIdFromGPAndGPSurgery(null);
	}
	else if(form.getLocalContext().getMessageBoxIdFromAddresCollection() != null && messageBoxId == form.getLocalContext().getMessageBoxIdFromAddresCollection())
	{
		if(DialogResult.YES.equals(result))
		{
			form.getLocalContext().getResultPatient().setAddresses(form.getLocalContext().getAddressCollection());
		}
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addDynGridRow(TumourGroupSiteTNMValueVo voTNM, boolean isActive)
{
	if (voTNM == null)
		return;

	DynamicGridRow dynRow = form.lyrConfig().tabTNM().lyrTNM().tabTNMValues().dynTNM().getRows().newRow();

	DynamicGridCell typeCell = dynRow.getCells().newCell(getColumn(COLTYPE), DynamicCellType.ANSWER);
	bindTNMTypeLookup(typeCell);
	if (voTNM.getTNMTypeIsNotNull())
	{
		typeCell.setValue(voTNM.getTNMType());
		typeCell.setReadOnly(true);
		if (isEditMode())
			typeCell.setBackColor(Color.LightGray);
	}

	DynamicGridCell tnmCell = dynRow.getCells().newCell(getColumn(COLTNM), DynamicCellType.STRING);
	if (voTNM.getTNMValueIsNotNull())
	{
		tnmCell.setValue(voTNM.getTNMValue());
		tnmCell.setReadOnly(true);
		if (isEditMode())
			tnmCell.setBackColor(Color.LightGray);
	}

	DynamicGridCell cpbCell = dynRow.getCells().newCell(getColumn(COLCPB), DynamicCellType.ENUMERATION);
	bindTNMClinicalpathologicalLookup(cpbCell);
	if (voTNM.getClinicalPathologicalIsNotNull())
	{
		cpbCell.setValue(voTNM.getClinicalPathological());
		cpbCell.setReadOnly(true);
		if (isEditMode())
			cpbCell.setBackColor(Color.LightGray);
	}

	DynamicGridCell descCell = dynRow.getCells().newCell(getColumn(COLTNMDESCRIPTION), DynamicCellType.STRING);
	if (voTNM.getTNMDescriptionIsNotNull())
	{
		descCell.setValue(voTNM.getTNMDescription());
	}
	// WDEV-7804 - Set cell maximum string limit to 500
	descCell.setStringMaxLength(500);

	if (!isActive)
	{
		DynamicGridCell activeCell = dynRow.getCells().newCell(getColumn(COLACTIVE), DynamicCellType.ANSWER);
		bindYesNoLookup(activeCell);
		if (voTNM.getIsActiveIsNotNull())
		{
			if (voTNM.getIsActive())
				activeCell.setValue(YesNo.YES);
			else
				activeCell.setValue(YesNo.NO);
		}
	}

	dynRow.setValue(voTNM);
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void ListTotalPatientsOnArea(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue("<b>Total No. of Patients<b>");
	cell.setBackColor(Color.LightSteelBlue);
	

	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{			
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		cell.setBackColor(Color.LightSteelBlue);
		String val=domain.totalPatientsOnArea(currentLocation, areas.get(i));
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue("<b>"+val+"<b>");
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
	
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>" + (overall_sum>0?String.valueOf(overall_sum):"-") + "</b>");
	cell.setBackColor(Color.LightSteelBlue);
	

}