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

The following are Jave code examples for showing how to use setIdentifier() 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
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Admin.NTPFCaseTypeConfigDialog) 
		&& result.equals(DialogResult.OK)
		//&& form.getGlobalContext().NTPF.getCaseTypesIsNotNull()
		//&& form.getGlobalContext().NTPF.getCaseTypes().size() > 0
		&& form.dyngrdOrganisationLocation().getSelectedRow() != null)
	{
		DynamicGridCell cell = form.dyngrdOrganisationLocation().getSelectedRow().getCells().get(form.dyngrdOrganisationLocation().getColumns().getByIdentifier(COL_ACCREDITATION_CASETYPES));
          	cell.setIdentifier(form.getGlobalContext().NTPF.getCaseTypes());
          	
          	if (form.dyngrdOrganisationLocation().getSelectedRow().getValue() instanceof HcpLocationVo)
          	{
          		((HcpLocationVo)form.dyngrdOrganisationLocation().getSelectedRow().getValue()).setCaseTypes(form.getGlobalContext().NTPF.getCaseTypes());
          	}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
@Override
protected void onDyngrdActionsCellTextSubmited(DynamicGridCell cell)
{
	cell.getItems().clear();
	AppUserShortVo appUserFilter = new AppUserShortVo();
	appUserFilter.setUsername(cell.getTypedText());
	AppUserShortVoCollection users = domain.listAppUsers(appUserFilter);
	if (users != null && users.size() > 0)
	{
		for (int i = 0; i < users.size(); i++)
		{
			DynamicGridCellItem item = cell.getItems().newItem(users.get(i).getUserRealName() + " (" + users.get(i).getUsername() + ")");
			item.setIdentifier(users.get(i));
		}
		if (users.size() == 1)
		{
			cell.setValue(users.get(0).getUserRealName() + " (" + users.get(0).getUsername() + ")");
			cell.setIdentifier(users.get(0));
		}
		else if (users.size() > 1)
			cell.showOpened();

		cell.getRow().setIdentifier(cell.getIdentifier());
	}
}
 
Example 3
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 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private DynamicGridRow addSelectedDiagnoseRow(DiagLiteVo diagnose)
{
	if(diagnose == null)
		return null;
	
	DynamicGridRow row = form.dyngrdDiagnosis().getRows().newRow();

	DynamicGridCell cell = row.getCells().newCell(getSelectedColumn(COLDIAGNOSE), DynamicCellType.LABEL);
	cell.setValue(diagnose.getDiagnosisName());
	cell.setIdentifier(diagnose.getDiagnosisName());
	cell.setTooltip(diagnose.getDiagnosisName());
	cell.setReadOnly(true);

	cell = row.getCells().newCell(getSelectedColumn(COLMAIN), DynamicCellType.BOOL);
	cell.setAutoPostBack(true);
	
	if(diagnose.equals(form.getLocalContext().getMainDiagnosis()) && !isDiagnosisAlreadyAdded(diagnose))
	{
		cell.setValue(true);
	}
	
	cell = row.getCells().newCell(getSelectedColumn(COLIMAGE), DynamicCellType.IMAGEBUTTON);
	cell.setValue(form.getImages().Core.Minus);
	cell.setTooltip("Remove Diagnosis");
	cell.setAutoPostBack(true);
	
	row.setValue(diagnose);
	
	return row;
}
 
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 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 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void populateLyrDetailsTabDifferentation(TumourGroupVo voGroup)
	{
		initialiseDifferentationDynamicGrid();
		form.lyrConfig().tabHistologyGrade().dyngrdDifferentation().getRows().clear();
		TumourGroupHistopathologyGradeVoCollection voColl = voGroup.getHistopathologicGrades();

		for (int i = 0; voColl != null && i < voColl.size(); i++)
		{
			TumourGroupHistopathologyGradeVo tumourGroupHistopathologicGrade = voColl.get(i);
			
			DynamicGridRow row = form.lyrConfig().tabHistologyGrade().dyngrdDifferentation().getRows().newRow();

			DynamicGridCell diffCell = row.getCells().newCell(getDiffColumn(COLDIFF), DynamicCellType.STRING);

			diffCell.setValue(tumourGroupHistopathologicGrade.getTumourDifferentation().toString());
			diffCell.setIdentifier(tumourGroupHistopathologicGrade.getTumourDifferentation().getTumourDifferentation());
			
			diffCell = row.getCells().newCell(getDiffColumn(COLGRADE), DynamicCellType.STRING);
			diffCell.setValue(tumourGroupHistopathologicGrade.getTumourDifferentation().getGrade());
			
			row.setTextColor(Boolean.TRUE.equals(tumourGroupHistopathologicGrade.getIsActive()) ? Color.Black : Color.Gray);
			
			row.setValue(tumourGroupHistopathologicGrade);
		}

//		form.getLocalContext().setDifferentationCollection(domain.listAllTumourDiffs());
//		form.getLocalContext().setDifferentationSavedCollection(voColl);
	}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void createChildren(DynamicGridRow row, ReferralApptStatusCollection linkedReferralStatus)
{
	ReferralApptStatusCollection refStatusColl = getStatusList();
	refStatusColl.sort();

	if (linkedReferralStatus != null)
	{
		linkedReferralStatus.sort();

		for (int j = 0; j < linkedReferralStatus.size(); j++)
		{
			if (refStatusColl.contains(linkedReferralStatus.get(j)))
			{
				refStatusColl.remove(linkedReferralStatus.get(j));
			}
		}
	
		for (int i = 0; i < linkedReferralStatus.size(); i++)
		{
			DynamicGridRow childrow = row.getRows().newRow();

			refStatusColl.remove((ReferralApptStatus) row.getValue());
			refStatusColl.add(linkedReferralStatus.get(i));
			refStatusColl.sort();
			
			DynamicGridCell cell = childrow.getCells().newCell(form.dyngrdStatus().getColumns().get(0), DynamicCellType.ENUMERATION);
			populateCell(refStatusColl, cell, row);
			cell.setIdentifier(linkedReferralStatus.get(i).getIItemText());
			cell.setValue(linkedReferralStatus.get(i));
			childrow.setCollapsedImage(form.getImages().Core.Link);
			childrow.setValue(linkedReferralStatus.get(i));

		}
	}

}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, Question_AnswerTypeVo configAnswer, Answer_DetailsVo instAnswer, boolean readOnly, boolean readOnlyBecauseUserHasNoRoles) throws PresentationLogicException
{
	checkDataIntegrity(configAnswer);

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

	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);
	setCellTooltip(cell, configAnswer, readOnlyBecauseUserHasNoRoles);//wdev-3709

	return cell;
}
 
Example 10
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;
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void displayCorrespondance(ClinicalCorrespondenceLiteVoCollection collection)
{
	formatGrid();
	
	form.dyngrdCorrespondence().getRows().clear();
	
	for (int i = 0; collection != null && i < collection.size(); i++)
	{
		ClinicalCorrespondenceLiteVo voCCLite = collection.get(i);
		
		DynamicGridRow row = form.dyngrdCorrespondence().getRows().newRow();

		DynamicGridCell cellAuthorDate = row.getCells().newCell(getColByIdentifier(COL_AUTH_DATE), DynamicCellType.LABEL);
		cellAuthorDate.setValue(voCCLite.getAuthoringInformation().getAuthoringDateTimeIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringDateTime().toString() : "");
		cellAuthorDate.setIdentifier(COL_AUTH_DATE);
		cellAuthorDate.setWidth(130);

		DynamicGridCell cellAuthorHCP = row.getCells().newCell(getColByIdentifier(COL_AUTH_HCP), DynamicCellType.LABEL);
		cellAuthorHCP.setValue(voCCLite.getAuthoringInformation().getAuthoringHcpIsNotNull() ? voCCLite.getAuthoringInformation().getAuthoringHcp().toString() : "");
		cellAuthorHCP.setIdentifier(COL_AUTH_HCP);
		cellAuthorHCP.setWidth(140);

		DynamicGridCell cellPatName = row.getCells().newCell(getColByIdentifier(COL_PAT_NAME), DynamicCellType.LABEL);

		PatientShort patient = null;
		if(voCCLite.getCareContextIsNotNull() && voCCLite.getCareContext().getEpisodeOfCareIsNotNull() && voCCLite.getCareContext().getEpisodeOfCare().getCareSpellIsNotNull())
			patient = voCCLite.getCareContext().getEpisodeOfCare().getCareSpell().getPatient();
		cellPatName.setValue(patient != null? patient.getName().toShortForm() : "");
		cellPatName.setIdentifier(COL_PAT_NAME);
		cellPatName.setWidth(140);

		DynamicGridCell cellPatNumber = row.getCells().newCell(getColByIdentifier(COL_PAT_NUM), DynamicCellType.LABEL);
		cellPatNumber.setValue(patient != null && patient.getDisplayId() != null? patient.getDisplayId().getValue() : "");
		cellPatNumber.setIdentifier(COL_PAT_NUM);
		cellPatNumber.setWidth(70);

		if (form.cmbStatus().getValue() == null)
		{
			DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(COL_STATUS), DynamicCellType.LABEL);
			cellStatus.setValue(voCCLite.getCurrentStatusIsNotNull() ? voCCLite.getCurrentStatus().getCorrespondenceStatus().toString() : "");
			cellStatus.setIdentifier(COL_STATUS);
			cellStatus.setWidth(100);
		}

		DynamicGridCell cellRespHCP = row.getCells().newCell(getColByIdentifier(COL_RESP_HCP), DynamicCellType.LABEL);
		cellRespHCP.setValue(voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCPIsNotNull() ? voCCLite.getCareContext().getEpisodeOfCare().getResponsibleHCP().toString() : "");
		cellRespHCP.setIdentifier(COL_RESP_HCP);
		cellRespHCP.setWidth(140);

		DynamicGridCell cellNote = row.getCells().newCell(getColByIdentifier(COL_NOTE), DynamicCellType.HTMLVIEW);

		if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE) )
		{
			if (voCCLite.getInpatientDischargeSummaryIsNotNull())
				cellNote.setValue(voCCLite.getInpatientDischargeSummary().getClinicalNoteIsNotNull() ? voCCLite.getInpatientDischargeSummary().getClinicalNote().getClinicalNote().toString() : "");
		}
		else if (voCCLite.getTypeIsNotNull() && voCCLite.getType().equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER) )
		{
			if (voCCLite.getOPDNotesIsNotNull())
				cellNote.setValue(voCCLite.getOPDNotes().getClinicalNoteIsNotNull() ? voCCLite.getOPDNotes().getClinicalNote().getClinicalNote().getClinicalNote().toString() : "");
		}
		
		cellNote.setIdentifier(COL_NOTE);
		cellNote.setWidth(-1);

		row.setValue(voCCLite);
	}
}
 
Example 12
Project: AvoinApotti   File: OrganisationLocationHelper.java   View Source Code Vote up 4 votes
private void populateLocations(LocMostVoCollection locations, Object objectTreeOrGrid)
{
	if (locations == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locations.size(); i++)
	{
		LocMostVo voLoc = locations.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		if (voLoc.getIsVirtualIsNotNull() && voLoc.getIsVirtual().booleanValue())
			continue;

		Image img = voLoc.getIsActive().booleanValue() ? locImg: locDisImg;			
		if (this.tree != null)
		{
			TreeNode parentNode = (TreeNode) objectTreeOrGrid;

			locNode = parentNode.getNodes().add(voLoc, voLoc.getName(), LOC_NODE, new int[]{LS_NODE,LOC_NODE}, true);
			locNode.setCollapsedImage(img);
			locNode.setExpandedImage(img);	
			locNode.setCheckBoxVisible(showCheckBoxes);

			populateLocations(voLoc.getLocations().sort(), locNode);
		}
		else
		{
			DynamicGridRow rowParent = (DynamicGridRow)objectTreeOrGrid;
			DynamicGridRow row = null;
			row = rowParent.getRows().newRow();

			DynamicGridCell cell1 = row.getCells().newCell(getColByIdentifier(COL_DESC), DynamicCellType.LABEL);
			cell1.setValue(voLoc.getNameIsNotNull() ? voLoc.getName() : "");
			cell1.setIdentifier(voLoc.getName());

			row.setValue(voLoc);
			row.setCheckBoxVisible(showCheckBoxes);

			row.setCollapsedImage(img);
			row.setExpandedImage(img);
			
			populateLocations(voLoc.getLocations().sort(), row);
		}
	}		
}
 
Example 13
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 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addSeed(ReportSeedParsedVo voSeed)
{
	if (voSeed == null)
		return;

	DynamicGridRow row = form.dyngrdParameters().getRows().newRow();

	DynamicGridCell nameCell = row.getCells().newCell(getColumn(NAME_COLUMN), DynamicCellType.WRAPTEXT);
	String seedName = getReportSeed().getCellName(voSeed);
	nameCell.setValue(seedName);
	nameCell.setReadOnly(true);

	DynamicCellType cellType = null;
	
	if(voSeed.getType().equalsIgnoreCase(INTEGER) && (voSeed.getName().equalsIgnoreCase("DOB") || voSeed.getName().equalsIgnoreCase("DOB_START") || voSeed.getName().equalsIgnoreCase("DOB_END") || voSeed.getName().equalsIgnoreCase("DATE_OF_BIRTH_FROM") || voSeed.getName().equalsIgnoreCase("DATE_OF_BIRTH_TO")))
	{
		cellType = DynamicCellType.PARTIALDATE;
	}
	else
		cellType = getReportSeed().getCellType(voSeed);
	
	Object value = getReportSeed().getValue(voSeed);

	DynamicGridCell valueCell = row.getCells().newCell(getColumn(VALUE_COLUMN), cellType);
	if (cellType.equals(DynamicCellType.QUERYCOMBOBOX))
	{
		valueCell.getItems().newItem(value);
		valueCell.setAutoPostBack(true);
	}

	if(cellType.equals(DynamicCellType.PARTIALDATE) && value instanceof java.lang.Integer)
	{
		valueCell.setValue(new PartialDate((Integer)value));
	}
	else
	{	
		valueCell.setValue(value);
	}
	
	valueCell.setIdentifier(getReportSeed().getIdentifier(voSeed));

	boolean canBeNull = voSeed == null ? true : voSeed.getCanBeNull().booleanValue();
	valueCell.setCanBeEmpty(canBeNull);
	
	if(canBeNull == false)
	{
		DynamicGridCell mandatoryCell = row.getCells().newCell(getColumn(MANDATORY_COLUMN), DynamicCellType.HTMLVIEW);
		mandatoryCell.setValue("<font color='#FF0000' size='3'>*</font>");
		mandatoryCell.setTooltip("Required");
		
		valueCell.setValidationMessage(seedName + " is mandatory");
	}
	
	row.setValue(voSeed);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void setCellAnswer(DynamicGridCell cell, Answer_DetailsVo answer)
{
	if (cell == null)
		return;
	if (answer == null)
		return;
	Question_AnswerTypeVo answerType = null;
	if (cell.getIdentifier() instanceof Question_AnswerTypeVo)
		answerType = (Question_AnswerTypeVo) cell.getIdentifier();
	else if (cell.getIdentifier() instanceof Answer_CellData)
		answerType = ((Answer_CellData) cell.getIdentifier()).getConfigData();

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

	if (cell.getType() == DynamicCellType.ANSWER)
	{
		if (answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if (cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if (cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if (cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if (cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());
	}
	else if (cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if (cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if (cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.MULTISELECT)
	{
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void setDoseRowValue(DynamicGridRow row, MedicationDose dose)
{
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not set a dose to null row");
	
	row.setValue(dose);
	
	if (dose == null)
		return;
	
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSENAME), DynamicCellType.STRING);
	cell.setValidationMessage("Dose length is restricted to 255 characters.");
	cell.setValue(dose.getDose());
	cell.setWidth(120);
	cell.setReadOnly(true);
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.ENUMERATION);
	// 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.setValue(dose.getAdminRoute());
	cell.setWidth(120);
	cell.setReadOnly(true);
	
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.STRING);
	cell.setIdentifier(dose.getDoseStartHcp());
	cell.setValue(dose.getDoseStartHcp() != null ? dose.getDoseStartHcp().toString() : "");
	cell.setWidth(200);
	cell.setReadOnly(true);
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.DATE);
	cell.setValue(dose.getDoseStartDate());
	cell.setWidth(-1);
	cell.setReadOnly(true);
	
	row.setIdentifier(ROW_STATE_NOT_EDITABLE);
}
 
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: MedicationDosesDynamicGridPopulation.java   View Source Code Vote up 4 votes
private boolean addDoseRow(DynamicGridRow row, MedicationDose voDose, boolean bHideDiscontinued, Color objColor)
{
  	if(voDose == null || row == null)
		throw new CodingRuntimeException("Dose or Row not sent - Coding Error");

	if ( (bHideDiscontinued) && (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue())) 
		return false;
	
	DynamicGridRow childRow = row.getRows().newRow();
	DynamicGridCell cell1 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_DOSE), DynamicCellType.LABEL);
	cell1.setValue(voDose.getDoseIsNotNull() ? voDose.getDose() : "");
	cell1.setIdentifier(voDose.getDose());
	cell1.setTooltip(voDose.getDiscontinuedTooltip());

	DynamicGridCell cell2= childRow.getCells().newCell(getColByIdentifier(COL_DOSE_ROUTE), DynamicCellType.LABEL);
	cell2.setValue(voDose.getAdminRouteIsNotNull() ? voDose.getAdminRoute().toString() : "");
	cell2.setIdentifier(voDose.getAdminRoute());

	DynamicGridCell cell3 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_TIMES), DynamicCellType.LABEL);
	cell3.setValue(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : "");
	cell3.setTooltip(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : "");
	cell3.setIdentifier(voDose.getAdminTimes());

	DynamicGridCell cell4 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.LABEL);
	cell4.setValue(voDose.getDoseStartHcpIsNotNull() ? voDose.getDoseStartHcp().toString() : "");
	cell4.setIdentifier(voDose.getDose());
		
	DynamicGridCell cell5 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.LABEL);
	cell5.setValue(voDose.getDoseStartDateIsNotNull() ? voDose.getDoseStartDate().toString() : "");
	cell5.setIdentifier(voDose.getDose());

	childRow.setValue(voDose);
		
	childRow.setExpanded(true);
	childRow.setSelectable(false);
	childRow.setBackColor(objColor);
	childRow.setExpandedImage(this.tabletdoseImage);
	childRow.setCollapsedImage(this.tabletdoseImage);

	if ( (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()) )
		childRow.setBold(false);
	else
		childRow.setBold(true);

	return true;
}
 
Example 19
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 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Clinical.TeamMemberSelection) && (result.equals(DialogResult.OK) || result.equals(DialogResult.YES)))
	{
		ClinicalTeamMemberVoCollection voClinicalTeamMemberColl = form.getGlobalContext().Clinical.getTeamMemberSelection();
		if (voClinicalTeamMemberColl == null || voClinicalTeamMemberColl.size() == 0)
			return;

		for (int x = 0; x < voClinicalTeamMemberColl.size(); x++)
		{
			if (voClinicalTeamMemberColl.get(x) != null)
			{
				DynamicGridRow row = form.ctnDetails().dyngrdInvitees().getRows().newRow();

				row.setValue(voClinicalTeamMemberColl.get(x).getHCP());

				if (voClinicalTeamMemberColl.get(x).getHCPIsNotNull())
				{
					DynamicGridCell cellInvitee = row.getCells().newCell(getColByIdentifier(INVITEE_COLUMN), DynamicCellType.QUERYCOMBOBOX);
					cellInvitee.setWidth(100);
					cellInvitee.getItems().newItem(voClinicalTeamMemberColl.get(x).getHCP());
					cellInvitee.setTypedText(voClinicalTeamMemberColl.get(x).getHCP().toString());
					cellInvitee.setValue(voClinicalTeamMemberColl.get(x).getHCP());
					cellInvitee.setReadOnly(true);
					cellInvitee.setIdentifier(HcpLiteVo.class);
					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");

				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.setReadOnly(false);
				cellNote.setTooltip("Please add a note");
				cellNote.setStringMaxLength(255);

				row.setValue(voClinicalTeamMemberColl.get(x).getHCP());
			}
		}
	}
}