Java Code Examples for ims.framework.enumerations.DynamicCellType

The following are top voted examples for showing how to use ims.framework.enumerations.DynamicCellType. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onDyngrdSelectCellValueChanged(DynamicGridCell cell)
{
	if (cell.getType().equals(DynamicCellType.BOOL))
	{
		Object objVal = cell.getValue();
		if (objVal instanceof Boolean)
		{
			if (((Boolean) objVal).booleanValue())
			{
				deselectCells(cell);
				enableSelectBtn(true);
			}
			else
			{
				enableSelectBtn(false);
			}
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addParentRow(TTAMedicationAndPharmacyForTTAHistoryVo tta)
{
	if (tta == null)
		return;
	DynamicGridRow parent = form.dyngrdTTA().getRows().newRow();
	parent.setValue(tta);
	DynamicGridCell newCell = parent.getCells().newCell(getGridColumn(NAME_IDENTIFIER), DynamicCellType.HTMLVIEW);

	newCell.setValue("<B>Created:</b> " + (tta.getSystemInfoIsNotNull() ? tta.getSystemInfo().getCreationDateTime() : "N/A") + " <B>By: </B>" + (tta.getOrderingClinicianIsNotNull() ? tta.getOrderingClinician().getIMosName() : "N/A"));
	newCell.setReadOnly(true);
	newCell = parent.getCells().newCell(getGridColumn(SELECT_IDENTIFIER), DynamicCellType.BOOL);
	newCell.setReadOnly(false);
	newCell.setAutoPostBack(true);
	addChildRows(tta.getTTAMedications(), parent);

}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addNoteRow(DynamicGridRow categoryRow, AppointmentClinicalNotesVo note, Image rowImage)
{
	if(categoryRow == null)
		return;
	
	DynamicGridRow 	noteRow = categoryRow.getRows().newRow();
	noteRow.setSelectable(true);
	noteRow.setExpandedImage(rowImage);
	noteRow.setCollapsedImage(rowImage);
	noteRow.setValue(note);
	
	DynamicGridCell cellNote = noteRow.getCells().newCell(getCol(COL_TITLE_HIERARCHICAL), DynamicCellType.STRING);	
	String title = getTitleFromNote(note);
	
	cellNote.setReadOnly(true);
	cellNote.setValue(title);
	cellNote.setTooltip(title);
}
 
Example 4
Project: AvoinApotti   File: ResultDisplayHelper.java   Source Code and License 6 votes vote down vote up
private void addCommentsToResult(DynamicGridRow row, ResultComponentCommentsVoCollection resultComments)
{
	if (resultComments == null)
		return;
	for (int i = 0 ; i < resultComments.size() ; i++)
	{
		DynamicGridRow newRow = row.getRows().newRow();
		DynamicGridColumn colTest = grid.getColumns().getByIdentifier(ResultDisplayHelper.COL_TEST);
		DynamicGridCell cell = newRow.getCells().newCell(colTest,DynamicCellType.WRAPTEXT);
		cell.setReadOnly(true);//WDEV-16232
		cell.setValue(resultComments.get(i).getCmtText());
		colTest.setCanGrow(true);
		colTest.setDynamicWidthSupported(true);
		cell.setWidth(700);
	}
	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow getReportRow(ReportForPatientDocumentVo report, DynamicGrid dynGrid)
{

	for (int i = 0; i < dynGrid.getRows().size(); i++)
	{
		if (report.equals(dynGrid.getRows().get(i).getValue()))
			return dynGrid.getRows().get(i);

	}
	DynamicGridRow reportRow = dynGrid.getRows().newRow();

	reportRow.setValue(report);
	reportRow.setSelectable(false);
	reportRow.setCollapsedImage(form.getImages().Core.ReportDesigner);
	reportRow.setExpandedImage(form.getImages().Core.ReportDesigner);

	DynamicGridCell cell = reportRow.getCells().newCell(getColumn(dynGrid, COLUMN_NAME), DynamicCellType.LABEL);
	cell.setValue(report.getReportName());

	if (report.getImsIdIsNotNull() && report.getImsId().intValue() > 0)
	{
		reportRow.setTextColor(Color.Blue);
	}
	
	return reportRow;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setColNeedReviewed(DynamicGridRow row, ClinicalNotesShortVoCollection voCollNotes, int i)
{
	DynamicGridColumn col = getCol("ICON");
	
	if(col == null)
		throw new DomainRuntimeException("No column for ICON");

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

	StringBuffer value = new StringBuffer();

	if (voCollNotes.get(i).getForReviewDisciplineIsNotNull() &&
			voCollNotes.get(i).getSourceOfNoteIsNotNull())
	{
			value.append("Review Discipline: " + voCollNotes.get(i).getForReviewDiscipline().toString().toUpperCase());
	}
	
	iconCell.setTooltip(value.toString());
	iconCell.setValue(form.getImages().Admin.ClinicalTeam);
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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 8
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow createOrFindInvestigationRow(GeneralQuestionAnswerVo generalQuestionAnswerVo) 
{
	if(generalQuestionAnswerVo == null)
		return null;
	
	DynamicGridRow row = null;
	
	for(int i=0; i<gridQuestions.getRows().size(); i++)
	{
		row = gridQuestions.getRows().get(i);
		
		if(row != null && row.getValue() != null && row.getValue().equals(generalQuestionAnswerVo.getItemId()))
			return row;
	}
	
	row = gridQuestions.getRows().newRow();
	
	row.setSelectable(false);
	DynamicGridCell cell = row.getCells().newCell(columnName, DynamicCellType.LABEL);
	row.setBackColor(Color.Beige);
	cell.setValue("Investigation " + this.questionOrInformation + " : " + generalQuestionAnswerVo.getItemName());
	row.setExpanded(true);
	row.setValue(generalQuestionAnswerVo.getItemId());
	
	return row;
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicCellType getCellAnswerType(ims.core.vo.lookups.QuestionAnswerType answerType)
{
	if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DATE))
		return DynamicCellType.DATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.DECIMAL))
		return DynamicCellType.DECIMAL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.INTEGER))
		return DynamicCellType.INT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
		return DynamicCellType.MULTISELECT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PARTIALDATE))
		return DynamicCellType.PARTIALDATE;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
		return DynamicCellType.ENUMERATION;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
		return DynamicCellType.DYNAMICLABEL;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TEXT))
		return DynamicCellType.WRAPTEXT;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.TIME))
		return DynamicCellType.TIME;
	else if (answerType.equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
		return DynamicCellType.ANSWER;

	return DynamicCellType.EMPTY;
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addNewRow()
{

	DynamicGridRow newRow = form.dyngrdTrackingArea().getRows().newRow();
	newRow.setSelectable(false);
	DynamicGridCell checkCell;
	for (int i = 0; i < form.getGlobalContext().Emergency.getTrackingAreaColumns().size(); i++)
	{
		if (form.getGlobalContext().Emergency.getTrackingAreaColumns().get(i).getColumn().getImage() != null)
		{
			checkCell = newRow.getCells().newCell(getColumn(form.getGlobalContext().Emergency.getTrackingAreaColumns().get(i).getColumn().getID()), DynamicCellType.IMAGE);
			checkCell.setValue(form.getGlobalContext().Emergency.getTrackingAreaColumns().get(i).getColumn().getImage());
			checkCell.getColumn().setAlignment(Alignment.CENTER);
		}
		else
		{
			checkCell = newRow.getCells().newCell(getColumn(form.getGlobalContext().Emergency.getTrackingAreaColumns().get(i).getColumn().getID()), DynamicCellType.STRING);
			String name = form.getGlobalContext().Emergency.getTrackingAreaColumns().get(i).getColHeader();
			name = name + "...";
			checkCell.setValue(name);
		}
	}

}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setColStatus(ClinicalNotesShortVo note, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Status");
	if (col == null)
		throw new DomainRuntimeException("No column for Identifier");

	DynamicGridCell statusCell = row.getCells().newCell(col, DynamicCellType.STRING);
	statusCell.setValue(note.getCurrentStatus().getStatus().getText());
	
	StringBuffer sb = new StringBuffer();
	sb.append("Status set by : ");
	sb.append(note.getCurrentStatus().getMOSIsNotNull() ? note.getCurrentStatus().getMOS().getName() : "");
	sb.append(" on ");
	sb.append(note.getCurrentStatus().getDateTimeIsNotNull() ? note.getCurrentStatus().getDateTime().toString() : "");
	statusCell.setTooltip(sb.toString());
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow addCategoryToGrid(DynamicGridRow parent, ProcedureCategory category)
{
	if (parent == null)
		throw new RuntimeException("Logic error - non null parameters expected");
	DynamicGridColumn mainCol = form.dyngrdMain().getColumns().getByIdentifier(MAIN_COLUMN);
	DynamicGridRow newRow = parent.getRows().newRow();
	newRow.setExpandedImage(form.getImages().Admin.CategoryEnabled16);
	newRow.setCollapsedImage(form.getImages().Admin.CategoryEnabled16);
	DynamicGridCell newCell = newRow.getCells().newCell(mainCol, DynamicCellType.ENUMERATION);
	
	if(category!=null)
	{
	newCell.getItems().newItem(category);
	newCell.setValue(category);
	}
	newCell.setAutoPostBack(true);
	return newRow;
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addAnaesthetisRow(LocalAnaestheticAdministeredVo localAnaestheticAdministeredVo)
{
	DynamicGridRow newRow = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getRows().newRow();
	newRow.setValue(localAnaestheticAdministeredVo);

	DynamicGridColumn column = null;
	DynamicGridCell cell = null;

	column = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getColumns().getByIdentifier(COL_DRUG);
	cell = newRow.getCells().newCell(column, DynamicCellType.ENUMERATION);

	populateLocalAnaesthetic(ims.clinical.vo.lookups.LookupHelper.getLocalAnaesthetic(domain.getLookupService()), cell);
	cell.setValue(localAnaestheticAdministeredVo != null ? localAnaestheticAdministeredVo.getLocalAnaesthetic() : null);
	cell.setAutoPostBack(true);
	updateCell(cell);

	column = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getColumns().getByIdentifier(COL_MLS);
	cell = newRow.getCells().newCell(column, DynamicCellType.DECIMAL);
	cell.setValue(localAnaestheticAdministeredVo != null ? localAnaestheticAdministeredVo.getMls() : null);
	form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().setSelectedRow(null);
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if(item != null)
	{
		if(item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{	
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private int countDynRowBoolean()
{
	int rowCount = 0;
	for (int i = 0; i < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().get(i);
		for (int j = 0; j < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().size(); j++)
		{
			DynamicGridCell cell = row.getCells().get(form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().get(j));
			if (cell != null && cell.getType() == DynamicCellType.BOOL)
			{
				rowCount++;
			}
		}
	}
	return rowCount;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private Answer_OptionVoCollection get_CellMultiAnswer(DynamicGridCell cell)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	Answer_OptionVoCollection result = new Answer_OptionVoCollection();

	for (int x = 0; x < cell.getItems().size(); x++)
	{
		if (cell.getItems().get(x).isChecked())
		{
			result.add((Answer_OptionVo) cell.getItems().get(x).getIdentifier());
		}
	}

	return result;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow addOtherRowTodyngrdReportTo()
{
	if (maxNoOfReportToRowsEqualsFlagValue())
		return null;

	DynamicGridRow row = form.lyrDetails().tabGenDetails().dyngrdReportTo().getRows().newRow();
	DynamicGridCell cellReportTo = row.getCells().newCell(form.lyrDetails().tabGenDetails().dyngrdReportTo().getColumns().getByIdentifier(REPORTTO_COLUMN), DynamicCellType.STRING);
	cellReportTo.setTooltip("Please enter a Name");
	cellReportTo.setStringMaxLength(149); //WDEV-14450
	cellReportTo.setReadOnly(false);
	DynamicGridCell cellAddress = row.getCells().newCell(form.lyrDetails().tabGenDetails().dyngrdReportTo().getColumns().getByIdentifier(ADDRESS_COLUMN), DynamicCellType.STRING);
	cellAddress.setTooltip("Please enter an Address");
	cellAddress.setStringMaxLength(150); //WDEV-14450
	cellAddress.setReadOnly(false);

	row.setIdentifier(ReportToType.FREE);
	return row;
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 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 20
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 5 votes vote down vote up
private void addQuestion(DynamicGridRow pRow, GeneralQuestionAnswerVo question, boolean previewMode) throws PresentationLogicException
{
	Image rowQuestionImage = null;
	if(question.getIQuestionTypeQuestion().getIsQuestionIsNotNull() && question.getIQuestionTypeQuestion().getIsQuestion().equals(Boolean.FALSE))
		rowQuestionImage = this.infoImage;
	else
	{
		rowQuestionImage = this.questionImage;
		if(question.getIQuestionTypeIsMandatory() != null && question.getIQuestionTypeIsMandatory().booleanValue())
			rowQuestionImage = this.mandatoryQuestionImage;
	}
	
	DynamicGridRow row = pRow.getRows().newRow();
	row.setSelectable(false);
	
	row.setCollapsedImage(rowQuestionImage);
	row.setExpandedImage(rowQuestionImage);
	
	DynamicGridCell questionNameCell = row.getCells().newCell(this.gridQuestions.getColumns().getByIdentifier(QUESTION_COLUMN), DynamicCellType.WRAPTEXT);
	questionNameCell.setReadOnly(true);
	questionNameCell.setValue(question.getIQuestionTypeQuestion().getText());
	
	row.setIdentifier(question);
	
	if(question.getQuestionIsNotNull() && previewMode == false)
		addAnswers(row, question);
}
 
Example 21
Project: AvoinApotti   File: ReportSeedsHelper.java   Source Code and License 5 votes vote down vote up
private DynamicCellType getBoReportType(ReportSeedParsedVo voReportSeed)
{
	String boName = voReportSeed.getBOName();
	String boField = voReportSeed.getBOField();

	if (boName != null && boField != null)
	{
		if (boName.equals(HCP_BO) && boField.equals("id"))
			return DynamicCellType.QUERYCOMBOBOX;

		if (boName.equals(GP_BO) && boField.equals("id"))
			return DynamicCellType.QUERYCOMBOBOX;

		if (boName.equals(MEDIC_BO) && boField.equals("id"))
			return DynamicCellType.QUERYCOMBOBOX;

		if (boName.equals(MOS_BO) && boField.equals("id"))
			return DynamicCellType.QUERYCOMBOBOX;

		if (boName.equals(ORG_BO) && boField.equals("id"))
			return DynamicCellType.QUERYCOMBOBOX;

		if (boName.equals(LOCATION_BO) && boField.equals("id"))
			return DynamicCellType.QUERYCOMBOBOX;

		if (boName.equals(LOC_SITE_BO) && boField.equals("id"))
			return DynamicCellType.QUERYCOMBOBOX;
		
		if (boName.equals(LOOKUPINSTANCE_BO) && boField.equals("id"))
			return DynamicCellType.ENUMERATION;
				
	}

	return DynamicCellType.INT;
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 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 23
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addFamilyMemberRowTodyngrdInvitee()
{
	DynamicGridRow row = form.ctnDetails().dyngrdInvitees().getRows().newRow();
	DynamicGridCell cellInvitee = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(INVITEE_COLUMN), DynamicCellType.STRING);
	cellInvitee.setWidth(100);
	cellInvitee.setTooltip("Please enter a Family Member Name");
	cellInvitee.setReadOnly(false);
	cellInvitee.setStringMaxLength(55);

	DynamicGridCell cellNote = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(NOTE_COLUMN), DynamicCellType.STRING);
	cellNote.setStringMaxLength(255);

	adStatusAndNoteCells(row);
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow addSelectedProcedureRow(ProcedureLiteVo procedure)
{
	if(procedure == null)
		return null;
	
	DynamicGridRow row = form.dyngrdProcedures().getRows().newRow();

	DynamicGridCell cell = row.getCells().newCell(getSelectedColumn(COLPROCEDURE), DynamicCellType.LABEL);
	cell.setValue(procedure.getProcedureName());
	cell.setIdentifier(procedure.getProcedureName());
	cell.setTooltip(procedure.getProcedureName());
	cell.setReadOnly(true);

	cell = row.getCells().newCell(getSelectedColumn(COLMAIN), DynamicCellType.BOOL);
	cell.setAutoPostBack(true);
	
	if(procedure.equals(form.getLocalContext().getPrimaryProcedure()) && !isProcedureAlreadyAdded(procedure))
	{
		cell.setValue(true);
	}
	
	cell = row.getCells().newCell(getSelectedColumn(COLIMAGE), DynamicCellType.IMAGEBUTTON);
	cell.setValue(form.getImages().Core.Minus);
	cell.setTooltip("Remove Procedure");
	cell.setAutoPostBack(true);
	
	row.setValue(procedure);
	
	return row;
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridCell getCycleDateCell(DynamicGridRow row)
{
	DynamicGridCell cycleDateCell = row.getCells().get(getColumnByIdentifier(CYCLE_DATE));
	if (cycleDateCell == null)
		cycleDateCell = row.getCells().newCell(getColumnByIdentifier(CYCLE_DATE), DynamicCellType.STRING);
	return cycleDateCell;
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createCollectorsCommentsCell(DynamicGridCell cell)
{
	if (cell.getRow().getValue() instanceof SpecimenWorkListItemListVo)
	{
		SpecimenWorkListItemListVo item = (SpecimenWorkListItemListVo) cell.getRow().getValue();

		if (item != null && item.getSpecimen() != null && item.getSpecimen().getCollectorComment() != null && item.getSpecimen().getCollectorComment().length() > 0)
		{
			DynamicGridCell cellText = cell.getRow().getCells().newCell(form.dyngrdCollect().getColumns().getByIdentifier(TEXT_COL), DynamicCellType.STRING);
			cellText.setValue(item.getSpecimen().getCollectorComment());
			cellText.setTooltip(item.getSpecimen().getCollectorComment());
			cellText.setReadOnly(true);
		}
	}
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridCell getStatusCell(DynamicGridRow row)
{
	DynamicGridCell cycleNumberCell = row.getCells().get(getColumnByIdentifier(CYCLE_ACTIVE));
	if (cycleNumberCell == null)
		cycleNumberCell = row.getCells().newCell(getColumnByIdentifier(CYCLE_ACTIVE), DynamicCellType.STRING);
	return cycleNumberCell;
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createControlsForCollection(DynamicGridRow row)
{
	clearVariableCells(row);
	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultDateValue(cell);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultTimeValue(cell);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.QUERYCOMBOBOX, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	getColumn(QUERY_COL).setAlignment(Alignment.LEFT);
	cell.setAutoPostBack(true);
	setDefaultMosValue(cell);
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(((row.getValue() instanceof SpecimenWorkListItemListVo)?((SpecimenWorkListItemListVo)row.getValue()):null), cell);
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRoleGridFromScreenMultipleGroupNoFlat()
{
	for (int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i);
		DynamicGridRow roleRow = null;
		if (row.getValue() instanceof AssessmentQuestionGroupVo)
		{
			roleRow = form.lyrTabs().tabRoles().dyngrdQuestions().getRows().newRow();
			roleRow.getCells().newCell(getGridColumn(COLUMN_QUESTIONGROUP, false), DynamicCellType.STRING);
			updateQuestionGroupRow((AssessmentQuestionGroupVo) row.getValue(), roleRow);
		}

		if (roleRow != null)
		{
			for (int j = 0; j < row.getRows().size(); j++)
			{
				DynamicGridRow childRow = row.getRows().get(j);
				if (childRow.getValue() instanceof AssessmentQuestionVo)
				{
					AssessmentQuestionVo value = (AssessmentQuestionVo) childRow.getValue();
					value.setIsMandatory((Boolean) childRow.getCells().get(getGridColumn(COLUMN_MANDATORY)).getValue());
					value.setAllowsMultipleAnswers((Boolean) childRow.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)).getValue());
					addRoleQuestionToGrid(value, childRow);
				}
			}
		}
	}
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newConsultantAssociationRow(DynamicGridRow parrentRow, MedicLiteVo medic)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add consultant association row to a null parrent row");
	
	if (medic == null)
		return;

	
	DynamicGridCell newCell;
	DynamicGridColumn column;
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow();
	newRow.setValue(medic);
	
	// Create the fist cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Core.User);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(medic.getName().toString());
	newCell.setReadOnly(true);
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setMotorChartDetailsRow(DynamicGridRow row, MotorChartAreaDetailVo motorChartDetails)
{
	if (motorChartDetails == null)
		return;

	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate a null row with value");

	// Set the row (setup the cells and cells values)
	DynamicGridColumn column;
	DynamicGridCell cell;

	// Create the first cell (stage)
	column = form.dyngrdMotorArea().getColumns().getByIdentifier(COL_MOTOR_AREA_DESCRIPTION);
	cell = row.getCells().newCell(column, DynamicCellType.HTMLVIEW);
	cell.setValue(motorChartDetails.getMotorAreaDescription());

	// Create the second cell
	column = form.dyngrdMotorArea().getColumns().getByIdentifier(COL_MOTOR_AREA_UPPER_LIMB);
	cell = row.getCells().newCell(column, DynamicCellType.BOOL);
	cell.setValue(motorChartDetails.getIsUpperLimb());

	// Create the third cell
	column = form.dyngrdMotorArea().getColumns().getByIdentifier(COL_MOTOR_AREA_LOWER_LIMB);
	cell = row.getCells().newCell(column, DynamicCellType.BOOL);
	cell.setValue(motorChartDetails.getIsLowerLimb());
	
	//Create the fourth cell
	column = form.dyngrdMotorArea().getColumns().getByIdentifier(COL_MOTOR_AREA_ACTIVE);
	cell = row.getCells().newCell(column, DynamicCellType.BOOL);
	cell.setValue(motorChartDetails.getIsActive());

	// Set row value
	row.setValue(motorChartDetails);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newConsultantAssociation(DynamicGridRow parrentRow)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a CONSULTANT association to a null parrent row");
	
	if (!(parrentRow.getValue() instanceof AssociationCategory) || ((AssociationCategory) parrentRow.getValue()) != AssociationCategory.CONSULTANTS)
		throw new CodingRuntimeException("Logical Error - Function must be called from CONSULTANTS category row only");

	
	parrentRow.setExpanded(true);
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow(true);
	newRow.setValue(new MedicLiteVo());
	form.dyngrdAssociations().resetScrollPosition();
	
	// Declare a new cell
	DynamicGridCell newCell;
	// Column identifier
	DynamicGridColumn column;
	
	// Create the first cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Core.User);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
	newCell.setAutoPostBack(true);
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onDyngrdPracticesCellValueChanged(DynamicGridCell cell)
{
	if (cell.getType().getID() == DynamicCellType.BOOL.getID())
	{
		if (cell.getValue().equals(Boolean.TRUE))
		{
			DynamicGridRow pRow;
			for (int i = 0; i < form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getRows().size();i++)
			{
				pRow = form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getRows().get(i);
				DynamicGridCell cellPrimary = pRow.getCells().get(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRIMARY));
				cellPrimary.setValue(Boolean.FALSE);
				//WDEV-16516
				if(pRow.getValue() instanceof GpToPracticesVo)
				{
					((GpToPracticesVo) pRow.getValue()).setIsPrimaryPractice(false);
				}
			}
			cell.setValue(Boolean.TRUE);
			//WDEV-16516
			if(cell.getRow().getValue()  instanceof GpToPracticesVo)
			{
				((GpToPracticesVo) cell.getRow().getValue()).setIsPrimaryPractice(true);
			}
		}
	}
}
 
Example 35
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addEntityField()
{
	DynamicGridRow entityFieldInstanceRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow().getRows().newRow();
	entityFieldInstanceRow.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) entityFieldInstanceRow.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridColumn valueColl = getColByIndexForActionGrid(count);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", count);
	}

	setRowIdentifier(entityFieldInstanceRow, count, null);

	DynamicGridCell valueCell = entityFieldInstanceRow.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);

	onDyngrdActionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createCommonControls(DynamicGridRow row)
{
	if(row.getCells().get(getColumn(BTN_COL)) == null)
	{
		DynamicGridCell cell = row.getCells().newCell(getColumn(BTN_COL), DynamicCellType.IMAGEBUTTON, DynamicGridCellOptions.EDITABLE_DATA_CELL);
		cell.setValue(form.getImages().OCRR.SaveGrid);
		cell.setTooltip("Save");
	}
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateRowClinic(DynamicGridRow childRow, ClinicLiteVo clinicLiteVo, boolean newClinic, boolean reviewClinic, boolean createRow) 
{
	if(createRow)
	{
		DynamicGridColumn column = null;
		DynamicGridCell cell = null;
		
		childRow.setValue(clinicLiteVo);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_IMAGE);
		cell = childRow.getCells().newCell(column, DynamicCellType.IMAGE);
		cell.setValue(form.getImages().Admin.Clinic01);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_HEADING);
		cell = childRow.getCells().newCell(column, DynamicCellType.STRING);
		cell.setReadOnly(true);
		cell.setValue(clinicLiteVo.getClinicName());
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE);
		cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
		engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
		cell.setAutoPostBack(false);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE);
		cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
		engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
		cell.setAutoPostBack(false);
	}
	
	if(newClinic)
	{
		childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
	}
	if(reviewClinic)
	{
		childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
	}
	
}
 
Example 39
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow addGroupRow(Assessment_QuestionGroupVo group, Assessment_QuestionVoCollection questions, Patient_AssessmentDataVo data) throws PresentationLogicException
{
	checkDataIntegrity(group);		
	
	DynamicGridColumn column = this.grid.getColumns().getByIdentifier(QUESTION_COLUMN);
	DynamicGridRow row = this.grid.getRows().newRow();		
	row.setBackColor(Color.Beige);
	row.setBold(true);
		row.setIdentifier(new Group_RowData(group, null));
	row.setExpanded(true);
	
	DynamicGridCell cell = row.getCells().newCell(column, DynamicCellType.WRAPTEXT);
	cell.setValue(group.getName());			
	cell.setReadOnly(true);	
	
	if(questions != null)
	{
		for(int x = 0; x < questions.size(); x++)
		{
			if(questions.get(x).getActiveStatusIsNotNull() 
					&& (data != null || questions.get(x).getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)))
			{
				if(data == null)
					addQuestionRow(row, questions.get(x), group, null);
				else
					addQuestionRow(row, questions.get(x), group, getInstAnswer(data, group, questions.get(x)));
			}
		}
	}
	
	return row;
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void List15MinLOSBreached(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("<15mins to LOS Breach");
	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.get15MinLOS(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 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateFlatRow(ValueObject vo, String date, String title, String consultant, Image image, boolean bWrapText)
{
	DynamicGridRow row = form.dyngrdNotes().getRows().newRow();
	DynamicGridColumn column = null;
	DynamicGridCell cell = null;
	
	column = form.dyngrdNotes().getColumns().getByIdentifier(COL_IMAGE_FLAT);
	cell = row.getCells().newCell(column, DynamicCellType.IMAGE);
	
	cell.setValue(form.getImages().RefMan.Procedures16);//image);
	
	column = form.dyngrdNotes().getColumns().getByIdentifier(COL_DATE_FLAT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	
	cell.setValue(date);
	
	column = form.dyngrdNotes().getColumns().getByIdentifier(COL_TITLE_FLAT);
	if (bWrapText)
		cell = row.getCells().newCell(column, DynamicCellType.WRAPTEXT);
	else
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
	
	cell.setValue(title);
	
	column = form.dyngrdNotes().getColumns().getByIdentifier(COL_CONSULTANT_FLAT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	
	cell.setValue(consultant);
	
	row.setReadOnly(true);
	row.setValue(vo);
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newClinicCorrespondenceGridRow(DynamicGridRow parentRow, ClinicAccessVo clinicAccess)
{
	if (parentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add clinical access row to a null row");
	
	if (clinicAccess == null)
		return;
		
	
	DynamicGridCell newCell;
	DynamicGridColumn column;

	// Create a new row
	DynamicGridRow newRow = parentRow.getRows().newRow();
	newRow.setValue(clinicAccess);
	
	// Create the first cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Clinic);
	
	// Create the second cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(clinicAccess.getClinic().getClinicName());
	newCell.setReadOnly(true);
	
	// Create the third cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	newCell = newRow.getCells().newCell(column, DynamicCellType.ANSWER);
	engine.populate(newCell, Access.getNegativeInstancesAsIItemCollection());
	newCell.setValue(clinicAccess.getAccessRight());
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newRowToMedication()
{
	ims.framework.controls.DynamicGridColumnCollection columns = form.lyrMain().tabDetails().dyngrdMedication().getColumns();
	DynamicGridRow nRow = form.lyrMain().tabDetails().dyngrdMedication().getRows().newRow();
	nRow.getCells().newCell(columns.getByIdentifier(COLUMN_MEDICATION), DynamicCellType.ENUMERATION).setAutoPostBack(true);
	nRow.getCells().newCell(columns.getByIdentifier(COLUMN_BATCHNO), DynamicCellType.STRING).setStringMaxLength(20);
	nRow.getCells().newCell(columns.getByIdentifier(COLUMN_EXPIRYDATE), DynamicCellType.DATE);
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newSpecialtyCorrespondenceGridRow(DynamicGridRow parentRow, SpecialtyAccessVo specialtyAccess)
{
	if (parentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add specialty access row to a null row");
	
	if (specialtyAccess == null)
		return;
	
	
	DynamicGridCell newCell;
	DynamicGridColumn column;

	// Create a new row
	DynamicGridRow newRow = parentRow.getRows().newRow();
	newRow.setValue(specialtyAccess);
	
	// Create the first cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Specialty2);

	// Create the second cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(specialtyAccess.getSpecialty().getText());
	newCell.setReadOnly(true);
	
	// Create the third cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	newCell = newRow.getCells().newCell(column, DynamicCellType.ANSWER);
	engine.populate(newCell, Access.getNegativeInstancesAsIItemCollection());
	newCell.setValue(specialtyAccess.getAccessRight());
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addConfigurableQuestions(DynamicGridRow row, WhiteBoardQuestionConfigVoCollection collOtherQuestions)
{
	if (collOtherQuestions==null)
		return;
	
	for (int i=0;i<collOtherQuestions.size();i++)
	{
		DynamicGridCell cellPain = row.getCells().newCell(getColumnByIdentifier(collOtherQuestions.get(i)), DynamicCellType.WRAPTEXT);
		cellPain.setValue(collOtherQuestions.get(i).getQuestionText());
		cellPain.setTooltip(collOtherQuestions.get(i).getQuestionText());
		cellPain.setReadOnly(true);
	}
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createControlsForCollection(DynamicGridRow row)
{
	clearVariableCells(row);
	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultDateValue(cell);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultTimeValue(cell);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.QUERYCOMBOBOX, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	getColumn(QUERY_COL).setAlignment(Alignment.LEFT);
	cell.setAutoPostBack(true);
	setDefaultMosValue(cell);
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(((row.getValue() instanceof SpecimenWorkListItemListVo) ? ((SpecimenWorkListItemListVo) row.getValue()) : null), cell);
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createNewChild(Object object, DynamicGridRow selectedRow)
{
	ReferralApptStatusCollection refAppStatusColl = getStatusList();
	ReferralApptStatusCollection usedrefAppStatusColl = getChildNodes(selectedRow);
	for (int i = 0; i < usedrefAppStatusColl.size(); i++)
	{
		if (refAppStatusColl.contains(usedrefAppStatusColl.get(i)))
		{
			refAppStatusColl.remove(usedrefAppStatusColl.get(i));
		}
	}

	if (object instanceof ReferralApptStatus)
	{

		refAppStatusColl.remove((ReferralApptStatus)object);

	}
	else if( selectedRow.getParent() != null)
	{
		
		refAppStatusColl.remove((ReferralApptStatus)object);
	}
	
	
	
	DynamicGridRow row = selectedRow.getRows().newRow();
	row.setCollapsedImage(form.getImages().Core.Link);
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdStatus().getColumns().get(0), DynamicCellType.ENUMERATION);
	populateCell(refAppStatusColl, cell, row);

	
	
	
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateRowGlossary(DynamicGridRow parentRow, GlossaryCategory glossaryCategory, GlossaryVo gCatVo) 
{
	DynamicGridColumn column = null;
	DynamicGridCell cell = null;
	
	column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_IMAGE);
	cell = parentRow.getCells().newCell(column, DynamicCellType.IMAGE);
	cell.setValue(form.getImages().Core.BookOpenEnabled);
	
	column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_HEADING);
	cell = parentRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setReadOnly(true);
	if(gCatVo != null && gCatVo.getGlossary() != null)
	{
		cell.setValue(gCatVo.getGlossary().toString());
	}
	else
	{
		gCatVo.setGlossary(glossaryCategory);
		cell.setValue(glossaryCategory.toString());
	}
	column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_TEXT);
	cell = parentRow.getCells().newCell(column, DynamicCellType.IMAGE);
	if(gCatVo != null && gCatVo.getGlossaryText() != null)
	{
		cell.setValue(form.getImages().Core.TextBox);
		cell.setTooltip(gCatVo.getGlossaryText());
	}
	cell.setReadOnly(true);
	parentRow.setValue(gCatVo);
	parentRow.setExpanded(true);
	parentRow.setBackColor(Color.Beige);
	if(gCatVo != null && gCatVo.getGlossaryTextIsNotNull())
	{
		populateProfileType(parentRow);
	}
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addFixedQuestions(DynamicGridRow row, WhiteBoardConfigVo whiteBoardConfig)
{
	if (whiteBoardConfig.getObsTaken())
	{
	DynamicGridCell cellObs = row.getCells().newCell(getColumnByIdentifier(COLUMN_OBS_REQUIRED), DynamicCellType.ENUMERATION);
	populateCellCombo(cellObs);
	}
	
	if (whiteBoardConfig.getMedsGiven())
	{
	DynamicGridCell cellMeds = row.getCells().newCell(getColumnByIdentifier(COLUMN_MEDS_GIVEN), DynamicCellType.ENUMERATION);
	populateCellCombo(cellMeds);
	}
	
	if (whiteBoardConfig.getECG())
	{
	DynamicGridCell cellECG = row.getCells().newCell(getColumnByIdentifier(COLUMN_ECG), DynamicCellType.BOOL);
	cellECG.setValue(null);
	cellECG.setAutoPostBack(true);
	cellECG.setReadOnly(false);
	}
	
	if (whiteBoardConfig.getNPO())
	{
	DynamicGridCell cellNPO = row.getCells().newCell(getColumnByIdentifier(COLUMN_NPO), DynamicCellType.BOOL);
	cellNPO.setValue(null);
	cellNPO.setAutoPostBack(true);
	cellNPO.setReadOnly(false);
	}
	
	if (whiteBoardConfig.getIsolation())
	{
	DynamicGridCell cellIsolation = row.getCells().newCell(getColumnByIdentifier(COLUMN_ISOLATION), DynamicCellType.BOOL);
	cellIsolation.setValue(null);
	cellIsolation.setAutoPostBack(true);
	cellIsolation.setReadOnly(false);
	}

}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addAssessmentsToGrid(DynamicGridRow row, WhiteBoardAssessmentConfigVoCollection collAssessments)
{
	if (collAssessments==null)
		return;
	
	for (int i=0;i<collAssessments.size();i++)
	{
		DynamicGridCell cellPain = row.getCells().newCell(getColumnByIdentifier(collAssessments.get(i)), DynamicCellType.INT);
		cellPain.setValue(i);
		cellPain.setTooltip(Integer.toString(i));
		cellPain.setReadOnly(true);
	}

}
 
Example 52
Project: AvoinApotti   File: ReportSeedsHelper.java   Source Code and License 5 votes vote down vote up
public DynamicCellType getCellType(ReportSeedParsedVo voReportSeed)
{
	if (voReportSeed == null)
		return DynamicCellType.LABEL;

	String dataType = voReportSeed.getType();
	if (dataType == null)
		return DynamicCellType.LABEL;

	if (dataType.equals(INTEGER) || dataType.equals(BIG_INTEGER) || dataType.equals(SHORT) || dataType.equals(LONG))
	{
		DynamicCellType defaultType = DynamicCellType.INT;

		if (dataType.equals(INTEGER))
			defaultType = getBoReportType(voReportSeed);

		return defaultType;
	}

	if (dataType.equals(BOOOLEAN))
		return DynamicCellType.BOOL;

	if (dataType.equals(STRING))
		return DynamicCellType.STRING;

	if (dataType.equals(BIG_DECIMAL) || dataType.equals(FLOAT) || dataType.equals(DOUBLE))
		return DynamicCellType.DECIMAL;

	if (dataType.equals(SQL_DATE))
		return DynamicCellType.DATE;

	if (dataType.equals(UTIL_DATE))
		return DynamicCellType.DATETIME;
	
	if (dataType.equals(SQL_TIME))
		return DynamicCellType.TIME;

	return DynamicCellType.LABEL;
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow createParent(ReferralApptStatus referralStatus)
{
	ReferralApptStatusCollection refStatusColl = getStatusList();
	refStatusColl.sort();
	ReferralApptStatusCollection refColl = form.getLocalContext().getusedParents();

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

		for (int j = 0; j < refColl.size(); j++)
		{
			if (refStatusColl.contains(refColl.get(j)))
			{
				refStatusColl.remove(refColl.get(j));
			}
		}
	}
	refStatusColl.add(referralStatus);
	refStatusColl.sort();
	DynamicGridRow row = form.dyngrdStatus().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdStatus().getColumns().get(0), DynamicCellType.ENUMERATION);
	row.setExpanded(true);
	populateCell(refStatusColl, cell, row);
	cell.setIdentifier(referralStatus.getIItemText());
	cell.setValue(referralStatus);
	row.setValue(referralStatus);

	return row;
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, Answer_OptionVoCollection items)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	if (cell.getItems() != null)
	{
		for (int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;

			if (items != null)
			{
				for (int y = 0; y < items.size(); y++)
				{
					if (cell.getItems().get(x).getIdentifier() != null && cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
		
		if(displayAnsweredOnly)	//WDEV-12349
		{
			for (int a = cell.getItems().size() -1; a >=0; a--)
			{
				if(cell.getItems().get(a) != null && !cell.getItems().get(a).isChecked())
					cell.getItems().remove(cell.getItems().get(a));
			}
		}
	}
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onGrdDetailsCellButtonClicked(DynamicGridCell cell)
{
	if (cell != null && cell.getType().equals(DynamicCellType.IMAGEBUTTON))
	{
		if(cell.getRow().getValue() instanceof PatientAssessmentQuestionVo)
		{
			PatientAssessmentQuestionVo voPatAssQuestion = (PatientAssessmentQuestionVo)cell.getRow().getValue();
			String url = getUrlText(voPatAssQuestion);
			if(url != null && url.length() > 0)
			{
				engine.openUrl(url);
			}		
		}
	}
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSummaryNoteDynamicGrid()
{
	form.lyrLetterCreate().tabTemplate().dyngrdSummaryNotes().getRows().clear();
	for(int i=0; i<form.lyrLetterCreate().tabClinicList().grdPatient().getRows().size(); i++)
	{	
		if(form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getcolDocCreate())
		{
			OutPatientListVo tempVo = form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getValue();
			if(tempVo.getPasEventIsNotNull() && tempVo.getPasEvent().getPatientIsNotNull())
			{
				DynamicGridRow patientRow = form.lyrLetterCreate().tabTemplate().dyngrdSummaryNotes().getRows().newRow();
				patientRow.setValue(tempVo);
				DynamicGridCell patientCell = patientRow.getCells().newCell(getColumnSummaryNotes(COLUMN_NAME), DynamicCellType.STRING);
				patientCell.setValue(tempVo.getPasEvent().getPatient().getName().getSurname());
				PatientSummaryNoteByHcpShortVoCollection tempColl = domain.listSummaryNotes(tempVo.getPasEvent().getPatient());
				DynamicGridCell summaryNoteCell = patientRow.getCells().newCell(getColumnSummaryNotes(COLUMN_SUMMARY), DynamicCellType.ENUMERATION);
				for(int j = 0; j < tempColl.size();j++)
				{
					if (tempColl.get(j) == null)
						continue;
					
					// Build string to be displayed
					StringBuilder displayText = new StringBuilder();
		
					displayText.append(tempColl.get(j).getAuthoringInformation().getAuthoringHcpIsNotNull() ? tempColl.get(j).getAuthoringInformation().getAuthoringHcp().toString() : "");
					displayText.append(" - " + tempColl.get(j).getAuthoringInformation().getAuthoringDateTime().toString());
		
					if (tempColl.get(j).getSystemInformationIsNotNull() && tempColl.get(j).getSystemInformation().getLastupdateDateTime() != null)
						displayText.append(" - " + tempColl.get(j).getSystemInformation().getLastupdateDateTime().toString());
					
					
					summaryNoteCell.getItems().newItem(tempColl.get(j), displayText.toString());
				}
				
			}
		}
	}
}
 
Example 57
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setCellMultiAnswer(DynamicGridCell cell, Answer_OptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridCell createCell(DynamicGridRow row, DynamicGridColumn column)
{
	DynamicGridCell cell = row.getCells().get(column);
	if (cell == null)
	{
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setReadOnly(true);
	}

	return cell;
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createControlsForCollection(DynamicGridRow row)
{
	clearVariableCells(row);
	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultDateValue(cell);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultTimeValue(cell);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.QUERYCOMBOBOX, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	cell.setAutoPostBack(true);
	setDefaultMosValue(cell);
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(((row.getValue() instanceof SpecimenWorkListItemListVo)?((SpecimenWorkListItemListVo)row.getValue()):null), cell);
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setColCorrect(DynamicGridRow row)
{
	DynamicGridColumn col = getCol("CORRECT");
	if (col == null)
		throw new DomainRuntimeException("No column for CORRECT");

	DynamicGridCell correctCell = row.getCells().newCell(col, DynamicCellType.IMAGE);
	correctCell.setValue(form.getImages().Core.CareSpell);
}