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

The following are Jave code examples for showing how to use setWidth() 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 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 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
/**
 * function used to populate dynamic grid row with neuro motor area finding
 */
private void setDynamicGridMotorAreaFindingRow(DynamicGridRow row, NeuroMotorAreaFindingVo finding)
{
	if (finding == null)
		return;

	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a finding to a null row");

	// Set the row
	DynamicGridColumn column;
	DynamicGridCell cell;

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_MOTOR_AREA);
	cell = row.getCells().newCell(column, DynamicCellType.HTMLVIEW);
	cell.setValue(finding.getMotorAreaIsNotNull() ? finding.getMotorArea().getMotorAreaDescription() : ""); // wdev-14406
	cell.setIdentifier(finding.getMotorArea());
	cell.setReadOnly(true);

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_RIGHT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(finding.getRightFinding() == null ? "" : (finding.getRightFinding() < 0 ? "N" : finding.getRightFinding().toString()));
	cell.setWidth(STANDARD_COLUMN_WIDTH);
	cell.setReadOnly(false);
	cell.setAutoPostBack(true);

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_LEFT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(finding.getLeftFinding() == null ? "" : (finding.getLeftFinding() < 0 ? "N" : finding.getLeftFinding().toString()));
	cell.setReadOnly(false);
	cell.setAutoPostBack(true);

	row.setValue(finding);
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void addPrescriptionDrugRow(DynamicGridRow row, PatientMedicationLiteVo patientMedication, boolean readOnly, boolean newRecord)
{
	DynamicGridColumn coll;
	DynamicGridCell cell;

	if (patientMedication == null)
		return;

	row.setIdentifier(PrescriptionDrug);
	row.setReadOnly(readOnly);
	
	if(newRecord)
		row.setBackColor(Color.Beige);

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_USER);
	cell = row.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	cell.setReadOnly(true);
	cell.setWidth(200);
	
	cell.setValue("<b><i>" + patientMedication.getMedication().getMedicationName() + "</i></b>");

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_DRUG);
	coll.setCaption("Frequency");
	cell = row.getCells().newCell(coll, DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setWidth(100);

	cell.setValue(patientMedication != null ? (patientMedication.getFrequencyIsNotNull() ? patientMedication.getFrequency().getIItemText() : null) : null);
	
	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_FREQUENCY);
	coll.setCaption("NoDaysSupply");
	cell = row.getCells().newCell(coll, DynamicCellType.INT);
	cell.setReadOnly(true);
	cell.setWidth(60);

	cell.setValue(patientMedication != null ? (patientMedication.getNoDaysSupplyIsNotNull() ? patientMedication.getNoDaysSupply() : null) : null);

	row.setValue(patientMedication);
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void newRow() 
	{
		DynamicGridRow row = form.dyngrdReasons().getRows().newRow();
		DynamicGridColumn coll = form.dyngrdReasons().getColumns().getByIdentifier("REASON");
		
		DynamicGridCell cell = row.getCells().newCell(coll, DynamicCellType.ENUMERATION);
		loadReasonCombo(cell);
		cell.setWidth(-1);
//		cell.setValue(note != null ? (note.getFollowUpTypeIsNotNull() ? note.getFollowUpType() : null)  : null);		
		cell.setReadOnly(false);		
		
	}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void addQueryComboRowTodyngrdInvitees(Class classType)
{
	DynamicGridRow row = form.ctnDetails().dyngrdInvitees().getRows().newRow();
	DynamicGridCell cellReportTo = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(INVITEE_COLUMN), DynamicCellType.QUERYCOMBOBOX);
	cellReportTo.setWidth(100);
	cellReportTo.setAutoPostBack(true);
	cellReportTo.setReadOnly(false);
	cellReportTo.setIdentifier(classType);
	if (classType.equals(HcpLiteVo.class))
		cellReportTo.setTooltip("Please search for a Member Of Staff");
	else
		cellReportTo.setTooltip("Please search for a GP");

	//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");

	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.setStringMaxLength(255);
	cellNote.setReadOnly(false);
	cellNote.setTooltip("Please add a note");
}
 
Example 6
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 7
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 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void populateRulesNotificationEntry(RuleValueConditionEntry entry, DynamicGridRow parentRow)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	DynamicGridColumn valueColl = getColByIndexForActionGrid(1);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", 1);
	}

	setRowIdentifier(row, 1, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	int count = row.getIdentifier() != null ? (row.getIdentifier() instanceof RuleConditionRowVo ? (((RuleConditionRowVo) row.getIdentifier()).getNumberOfColumns()) : 0) : 0;
	count++;
	try
	{
		addRuleNotificationCell(row, entry.getChild() != null ? entry.getChild() : entry, count);
	}
	catch (ParseException e)
	{
		e.printStackTrace();
	}
}
 
Example 9
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 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 4 votes
private DynamicGridRow addRootLogicalCondition(IRuleCondition ruleCondition)
{
	form.lyrRules().tabConditions().dyngrdConditions().getRows().clear();
	form.lyrRules().tabConditions().dyngrdConditions().clear();

	DynamicGridColumn rootConditionNameColumn = null;
	DynamicGridColumn rootConditionValueColumn = null;
	DynamicGridRow row = null;
	DynamicGridCell rootConditionCell = null;

	rootConditionNameColumn = createColumn("", 0);
	rootConditionValueColumn = createColumn("", 1);

	row = form.lyrRules().tabConditions().dyngrdConditions().getRows().newRow();
	setRowIdentifier(row, 2, RuleConditionType.FIRST_LOGICAL);

	form.getLocalContext().setIsFirstConditionDefined(true);

	rootConditionCell = row.getCells().newCell(rootConditionNameColumn != null ? rootConditionNameColumn : getColByIndex(0), DynamicCellType.HTMLVIEW);
	rootConditionCell.setWidth(60);
	rootConditionCell.setValue(" <b>IF</b> ");

	DynamicGridCell rootConditionValueCell = row.getCells().newCell(rootConditionValueColumn != null ? rootConditionValueColumn : getColByIndex(1), DynamicCellType.ENUMERATION);
	List<RuleLogicalCondition> listCondition = RuleLogicalCondition.getAll();
	for (int i = 0; i < listCondition.size(); i++)
	{
		rootConditionValueCell.getItems().newItem(listCondition.get(i));
		rootConditionValueCell.getItems().get(i).setIdentifier(listCondition.get(i));
	}

	row.setExpanded(true);

	rootConditionValueCell.setAutoPostBack(true);
	rootConditionValueCell.setWidth(120);
	rootConditionValueCell.setValue(ruleCondition);
	// rootConditionValueCell.setIdentifier(ruleCondition);

	form.lyrRules().tabConditions().dyngrdConditions().setValue(row);

	return row;
}
 
Example 12
Project: AvoinApotti   File: ResultDisplayHelper.java   View Source Code Vote up 4 votes
private void addNoResultRow(DynamicGridRow parentRow, boolean bNonResultable)
{
	if(parentRow == null)
		return;
	
	DynamicGridRow row = parentRow.getRows().newRow();
	DynamicGridCell cell;

	cell = row.getCells().newCell(grid.getColumns().getByIdentifier(COL_NAME), DynamicCellType.STRING);
	cell.setValue(bNonResultable ? "Non Resultable" : "No result to display.");
	cell.setWidth(300);
	cell.setReadOnly(true);

	DynamicGridColumn colTest = grid.getColumns().getByIdentifier(COL_TEST),
	  				  colValue = grid.getColumns().getByIdentifier(COL_VALUE),
	  				  colUnits = grid.getColumns().getByIdentifier(COL_UNITS),
	  				  colRefRange = grid.getColumns().getByIdentifier(COL_REF_RANGE),
	  				  colComments = grid.getColumns().getByIdentifier(COL_COMMENTS);
	
	if(colTest != null)
	{
		cell = row.getCells().newCell(grid.getColumns().getByIdentifier(COL_TEST), DynamicCellType.LABEL);
		colTest.setWidth(0);
		cell.setWidth(0);
	}
	if(colValue != null)
	{
		cell = row.getCells().newCell(grid.getColumns().getByIdentifier(COL_VALUE), DynamicCellType.LABEL);
		colValue.setWidth(0);
		cell.setWidth(0);
	}
	if(colUnits != null)
	{
		cell = row.getCells().newCell(grid.getColumns().getByIdentifier(COL_UNITS), DynamicCellType.LABEL);
		colUnits.setWidth(0);
		cell.setWidth(0);
	}

	if(colRefRange != null)
	{
		cell = row.getCells().newCell(grid.getColumns().getByIdentifier(COL_REF_RANGE), DynamicCellType.LABEL);
		colRefRange.setWidth(0);
		cell.setWidth(0);
	}

	if(colComments != null)
	{
		cell = row.getCells().newCell(grid.getColumns().getByIdentifier(COL_COMMENTS), DynamicCellType.WRAPTEXT);
		colComments.setWidth(0);
		cell.setWidth(0);
	}		
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addAnalyteComments(IChartValueAnalyte analytesComments)
{
	if (analytesComments == null || analytesComments.getIChartAnalyteComments() == null || analytesComments.getIChartAnalyteComments().length == 0)
		return;

	DynamicGridRow commentsRow = form.dyngrd().getRows().newRow();
	
	DynamicGridCell commentCell = commentsRow.getCells().newCell(form.dyngrd().getColumns().getByIdentifier(COLUMN_NAME), DynamicCellType.HTMLVIEW);
	commentCell.setWidth(700);
	
	StringBuilder comments = new StringBuilder();
	
	
	comments.append("<b>").append(analytesComments.getIChartAnalyteDate() != null ? analytesComments.getIChartAnalyteDate() : "<Unknown date>");
	comments.append(" - ").append(analytesComments.getIChartAnalyteDisplayFlag()).append(" - ").append(analytesComments.getIChartAnalyteSpecimenName());
	comments.append("</b><br>");
	
	comments.append("<b>Analyte:</b> ").append(analytesComments.getIChartAnalyteName()).append("<br>");
	
	for (int i = 0; i < analytesComments.getIChartAnalyteComments().length; i++)
	{
		IChartValueComment analyteComment = analytesComments.getIChartAnalyteComments()[i];
		
		if (analyteComment != null)
		{
			if (analyteComment.getIChartValueCommentText() != null)
			{
				comments.append("<br>").append(analyteComment.getIChartValueCommentText().replaceAll("\n", "<br>")).append("<br>");
			}
			else
			{
				comments.append("<br>");
			}
		}
	}
	
	comments.append("<br><br>");
	
	commentCell.setValue(comments.toString());
	commentCell.setReadOnly(true);
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addInvestigationComments(IChartValueInvestigation investigation)
{
	if (investigation == null || investigation.getIChartValueComments() == null || investigation.getIChartValueComments().length == 0)
		return;
	
	DynamicGridRow commentRow = form.dyngrd().getRows().newRow();

	DynamicGridCell commentCell = commentRow.getCells().newCell(form.dyngrd().getColumns().getByIdentifier(COLUMN_NAME), DynamicCellType.HTMLVIEW);
	commentCell.setWidth(700);

	StringBuilder comments = new StringBuilder();
	
	comments.append("<b>").append(investigation.getIChartValueInvestigationName()).append("</b> ").append("Comments:").append("<br>");
	comments.append("<b>Lab Order No:</b> ");
	
	if (investigation.getIChartValueInvestigationLabOrderNo() != null)
		comments.append(investigation.getIChartValueInvestigationLabOrderNo());
	else
		comments.append("Unknown Lab Order No.");
	
	comments.append(" - ");
	
	if (investigation.getIChartValueDisplayDate() != null)
		comments.append(investigation.getIChartValueDisplayDate());
	else
		comments.append("Unknown Date");

	if (investigation.getIChartValueDisplayFlag() != null)
		comments.append(" ").append(investigation.getIChartValueDisplayFlag());

	comments.append("<br>");
	

	for (int i = 0; i < investigation.getIChartValueComments().length; i++)
	{
		IChartValueComment investigationComment = investigation.getIChartValueComments()[i];
		
		if (investigationComment != null)
		{
			if (investigationComment.getIChartValueCommentText() != null)
			{
				comments.append("<br>").append(investigationComment.getIChartValueCommentText().replaceAll("\n", "<br>")); //WDEV-16697
			}
			else
			{
				comments.append("<br>");
			}
			
			comments.append("<br>");
		}
	}
	
	comments.append("<br><br>");
	commentCell.setValue(comments.toString());
	commentCell.setReadOnly(true);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void newDose()
{
	DynamicGridRow row = form.dyngrdDoses().getRows().newRow();
	
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSENAME), DynamicCellType.STRING);
	cell.setReadOnly(false);
	cell.setStringMaxLength(255);
	cell.setValidationMessage("Dose length is restricted to 255 characters.");
	cell.setWidth(120);
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.ENUMERATION);
	cell.setReadOnly(false);
	// bind to lookup
	cell.getItems().clear();
	MedicationRouteCollection medicationRouteCollection = LookupHelper.getMedicationRoute(domain.getLookupService());
	for (int i = 0; i < medicationRouteCollection.size(); i++)
	{
		MedicationRoute route = medicationRouteCollection.get(i);
		cell.getItems().newItem(route, route.getText());
	}
	cell.setWidth(120);

	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setIdentifier(domain.getHcpUser());
	cell.setValue(domain.getHcpUser() != null ? domain.getHcpUser().toString() : "");
	cell.setWidth(200);
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.DATE);
	cell.setReadOnly(true);
	cell.setValue(new Date());
	cell.setWidth(-1);
	
	row.setValue(new MedicationDose());
	
	row.setIdentifier(ROW_STATE_EDITABLE);

	// Update grid selection
	form.dyngrdDoses().setSelectedRow(row);
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Function used to populate a Patient ICP evaluation notes
 */
private void populatePatientICPEvaluationNotes(PatientICPEvaluationNoteVoCollection evaluationNotes)
{
	// Create a root row for evaluation notes
	DynamicGridRow notesRootRow = form.dyngrdICP().getRows().newRow();
	
	// Set row attributes
	notesRootRow.setSelectable(true);
	
	notesRootRow.setCollapsedImage(form.getImages().Core.Memo);
	notesRootRow.setExpandedImage(form.getImages().Core.Memo);
	
	// Fill in cell
	DynamicGridCell cell = notesRootRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_PRESENTATION), DynamicCellType.STRING);
	cell.setValue(EVALUATION_NOTES);
	cell.setReadOnly(true);
	cell.setWidth(300);
	
	// Set row value
	notesRootRow.setValue(EVALUATION_NOTES);
	
	
	// Sort evaluation notes
	evaluationNotes.sort(SortOrder.DESCENDING);
	
	// Add evaluation notes to root row
	for (PatientICPEvaluationNoteVo note : evaluationNotes)
	{
		// Create row for evaluation note
		DynamicGridRow noteRow = notesRootRow.getRows().newRow();
		
		// Set row attributes
		noteRow.setSelectable(true);
		
		noteRow.setCollapsedImage(form.getImages().Core.GreenSquare);
		noteRow.setCollapsedImage(form.getImages().Core.GreenSquare);
		
		// Fill in cells
		DynamicGridCell noteCell = noteRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_PRESENTATION), DynamicCellType.STRING);
		noteCell.setValue(buildEvaluationNoteText(note));
		noteCell.setTooltip(note.getNote());
		noteCell.setReadOnly(true);
		noteCell.setWidth(-1);
		
		// Set row value
		noteRow.setValue(note);
	}
	
	notesRootRow.setExpanded(true);
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Addes the given LocSiteVo to the given DynamicGridRow in the practices grid. 
 * @param LocSiteVo
 * @param DynamicGridRow
 */
private void populateSurgeries(LocSiteVo voSurgery, DynamicGridRow rowPractice)
{
	if (voSurgery != null && rowPractice != null)
	{
		DynamicGridRow rowSurgery = null;
		rowSurgery = rowPractice.getRows().newRow();

		DynamicGridColumn nameColumn = form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRACTICENAME);
		if(nameColumn == null)
			return;
		
		DynamicGridCell cell = rowSurgery.getCells().newCell(nameColumn, DynamicCellType.STRING);
		String name = ""; 
		if (voSurgery.getNameIsNotNull())
			name = voSurgery.getName();
		
		cell.setValue(name);
		cell.setTooltip(name);
		cell.setWidth(300);
		cell.setReadOnly(true);
		
		cell = rowSurgery.getCells().newCell(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_ADDRESS), DynamicCellType.STRING);
		cell.setReadOnly(true);//WDEV-15431
		if (voSurgery.getAddress() != null)
		{
			String strAddress = voSurgery.getAddress().toDisplayString();
			if(strAddress.endsWith(","))
			{
				strAddress = strAddress.substring(0,strAddress.length()-1);
			
			}
			
			
			cell.setValue(strAddress);
			cell.setTooltip(strAddress);
			cell.setWidth(-1);
		}
		
		rowSurgery.setCollapsedImage(form.getImages().Admin.LocationSite);
		rowSurgery.setExpandedImage(form.getImages().Admin.LocationSite);
		rowSurgery.setSelectable(false);
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Function used to populate a Patient ICP critical events
 */
private void populatePatientICPCriticalEvents(PatientCriticalEventsVoCollection criticalEvents)
{
	// Create parent row for Critical Events
	DynamicGridRow eventsRootRow = form.dyngrdICP().getRows().newRow();
	
	// Set row attributes
	eventsRootRow.setSelectable(true);
	
	eventsRootRow.setCollapsedImage(form.getImages().Core.CriticalError);
	eventsRootRow.setExpandedImage(form.getImages().Core.CriticalError);
	
	// Fill in cells for root row
	DynamicGridCell cell = eventsRootRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_PRESENTATION), DynamicCellType.STRING);
	cell.setValue(CRITICAL_EVENT);
	cell.setReadOnly(true);
	cell.setWidth(300);
	
	// Set row value
	eventsRootRow.setValue(CRITICAL_EVENT);
	
	
	// Sort critical events
	criticalEvents.sort(SortOrder.DESCENDING);
	
	// Add critical event to root row
	for (PatientCriticalEventsVo event : criticalEvents)
	{
		// Create row for critical event
		DynamicGridRow eventRow = eventsRootRow.getRows().newRow();
		
		// Set row attributes
		eventRow.setSelectable(true);
		
		eventRow.setCollapsedImage(form.getImages().Core.RedCircle);
		eventRow.setExpandedImage(form.getImages().Core.RedCircle);
		
		// Fill in cells for root row
		DynamicGridCell eventCell = eventRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_PRESENTATION), DynamicCellType.STRING);
		
		eventCell.setValue(buildCriticalEventText(event));
		eventCell.setReadOnly(true);
		eventCell.setTooltip(event.getNote());
		eventCell.setWidth(300);
		
		// Set row value
		eventRow.setValue(event);
	}
	
	eventsRootRow.setExpanded(true);
}
 
Example 19
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 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private DynamicGridRow addRuleLogicalCondition(RuleLogicalCondition condition)
{
	DynamicGridRow row = form.lyrRules().tabConditions().dyngrdConditions().getRows().get(0).getRows().newRow();
	row.setSelectable(true);

	int count = 1;

	DynamicGridColumn ifColl = getColByIndex(count);
	if (ifColl == null)
	{
		ifColl = createColumn("", count);
	}
	setRowIdentifier(row, count, RuleConditionType.LOGICAL);

	DynamicGridCell ifCell = row.getCells().newCell(ifColl, DynamicCellType.HTMLVIEW);
	ifCell.setValue(" <b>IF</b> ");
	ifCell.setWidth(30);

	count++;
	DynamicGridColumn valueColl = getColByIndex(count);
	if (valueColl == null)
	{
		valueColl = createColumn("", count);
	}
	setRowIdentifier(row, count, RuleConditionType.LOGICAL);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RuleLogicalCondition> listCondition = RuleLogicalCondition.getAll();
	for (int m = 0; m < listCondition.size(); m++)
	{
		valueCell.getItems().newItem(listCondition.get(m));
		valueCell.getItems().get(m).setIdentifier(listCondition.get(m));
	}

	row.setExpanded(true);
	valueCell.setAutoPostBack(true);
	valueCell.setWidth(120);

	valueCell.setValue(condition);
	valueCell.setIdentifier(condition);

	return row;
}