Java Code Examples for ims.framework.controls.DynamicGridRow

The following are top voted examples for showing how to use ims.framework.controls.DynamicGridRow. 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
private void addLineSeparator()
{
	DynamicGridRow messageRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow();
	if (messageRow != null)
	{
		DynamicGridRow lineSeparatorInstanceRow = messageRow.getRows().newRow();
		DynamicGridColumn lineSeparatorInstanceColl = getColByIndexForActionGrid(0);
		if (lineSeparatorInstanceColl == null)
		{
			lineSeparatorInstanceColl = createColumnForActionGrid("", 0);
		}
		DynamicGridCell lineSeparatorInstanceCell = lineSeparatorInstanceRow.getCells().newCell(lineSeparatorInstanceColl, DynamicCellType.HTMLVIEW);
		lineSeparatorInstanceCell.setAutoPostBack(true);
		lineSeparatorInstanceCell.setWidth(250);
		lineSeparatorInstanceCell.setValue("--- Line Separator ---");
		lineSeparatorInstanceRow.setIdentifier(NOTIFICATION_LINE_SEPARATOR_INSTANCE);
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow findRow(DynamicGridRow groupRow, Assessment_QuestionVo assessmentQuestion)
{
	if (assessmentQuestion == null)
		return null;

	DynamicGridRowCollection rows = null;
	if (groupRow != null)
		rows = groupRow.getRows();
	else
		rows = this.grid.getRows();

	for (int x = 0; x < rows.size(); x++)
	{
		DynamicGridRow row = rows.get(x);
		if (row.getIdentifier() != null && row.getIdentifier() instanceof Assessment_QuestionVo)
		{
			if (row.getIdentifier().equals(assessmentQuestion))
				return row;
		}
	}

	return null;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-16498
 * Function used to set the tool tip for Pathology Specimen Details grids
 */
private void setTooltipsForGrid(DynamicGrid dynGrid)
{
	for (int i = 0; i < dynGrid.getRows().size(); i++)
	{
		DynamicGridRow parentRow = dynGrid.getRows().get(i);
		
		if (!(parentRow.getIdentifier() instanceof OrderInvestigationVoCollection))
			throw new CodingRuntimeException("Logical error - parent row identifier must be an OrderInvestigationVoCollection");
		
		OrderInvestigationVoCollection investigations = (OrderInvestigationVoCollection) parentRow.getIdentifier();
		
		StringBuilder tooltip = new StringBuilder();
		
		for (OrderInvestigationVo investigation : investigations)
		{
			if (tooltip.length() > 0) tooltip.append(", ");
			tooltip.append(investigation.getInvestigation().getInvestigationIndex().getName());
		}
		
		parentRow.getCells().get(dynGrid.getColumns().getByIdentifier(DISCIPLINE_COLUMN)).setTooltip(tooltip.toString());
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createNewParent()
{
	ReferralApptStatusCollection refStatusColl = getStatusList();
	refStatusColl.sort();
	ReferralApptStatusCollection refColl = form.getLocalContext().getusedParents();
	refColl.sort();
	for (int j = 0; j < refColl.size(); j++)
	{
		if (refStatusColl.contains(refColl.get(j)))
		{
			refStatusColl.remove(refColl.get(j));
		}
	}
	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);
	form.dyngrdStatus().setSelectedRow(row);
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createVariableCells(DynamicGridRow row, boolean bDefault)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_LINETYPE), DynamicCellType.ENUMERATION);
	engine.populate(cell, LineType.getNegativeInstancesAsIItemCollection());
	cell.setReadOnly(false);
	if(bDefault)
	{
		cell.setValue(((DataSetTypeVo)row.getValue()).getDefaultLineType());
		cell.setReadOnly(true);
	}
	
	cell = row.getCells().newCell(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_COLOR_ICON), DynamicCellType.ENUMERATION);
	engine.populate(cell, LineColourPointIcon.getNegativeInstancesAsIItemCollection());
	cell.setReadOnly(false);
	if(bDefault)
	{
		cell.setValue(((DataSetTypeVo)row.getValue()).getDefLineColPtIcon());
		cell.setReadOnly(true);
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateDynGrid(CarePlanInterventionsCollection interventions)
{
	
	form.dyngrdActions().getRows().clear();
	form.dyngrdActions().setValue(null);
	if (interventions == null)
		return;
	 for (int i = 0 ; i < interventions.size() ;  i++)
	 {
		 if (shouldAdd(interventions.get(i)))
		 {
			 DynamicGridRow newRow = form.dyngrdActions().getRows().newRow();
			 populateDynGridRowFromData( newRow,interventions.get(i));
		 }
	 }
	
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createFindingStageRow(DynamicGridColumn colFinding, DynamicGridRow fsqRow, FindingStageQuestionsVo findingStageQuestionsVo)
{
	fsqRow.setValue(findingStageQuestionsVo);
	fsqRow.setReadOnly(true);
	
	DynamicGridCell cellFinding = fsqRow.getCells().get(colFinding);
	if (cellFinding == null)
		cellFinding = fsqRow.getCells().newCell(colFinding, DynamicCellType.STRING);

	cellFinding.setValue(findingStageQuestionsVo.getAssessmentStage().getStageName());
	cellFinding.setReadOnly(true);
	if(findingStageQuestionsVo.getAssessmentStage().getIsAnnotatedIsNotNull() && findingStageQuestionsVo.getAssessmentStage().getIsAnnotated().booleanValue())
	{
		fsqRow.setCollapsedImage(form.getImages().Admin.Brush);
		fsqRow.setExpandedImage(form.getImages().Admin.Brush);
	}
	else
	{
		fsqRow.setCollapsedImage(form.getImages().Admin.Page);
		fsqRow.setExpandedImage(form.getImages().Admin.Page);
	}
}
 
Example 8
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 9
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private void addAnswerData(DynamicGridRow row,  GeneralQuestionAnswerVo voQuestionAnswer)
{
	if(voQuestionAnswer.getPatientAnswers() == null)
		return;
	
	for(int x = 0; x < voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().size(); x++)
	{
		AnswerDetailsVo answer = voQuestionAnswer.getPatientAnswers().get(0).getAnswerDetails().get(x);
		DynamicGridCell cell = findCell(row, answer.getAnswerType());
		
		if(cell != null)
		{
			setCellAnswer(cell, answer);
		}
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onDyngrdICPRowSelectionChanged(DynamicGridRow row) throws PresentationLogicException
{
	form.getLocalContext().setSelection(form.dyngrdICP().getValue());
	
	// Update controls state
	updateControlsState();

	// Get selected action (if any) into local context
	boolean isActionSelected = form.dyngrdICP().getSelectedRow() != null && form.dyngrdICP().getSelectedRow().getValue() instanceof PatientICPAction_PresentationVo;
	
	if (isActionSelected)
		notifySelectedActionChanged((PatientICPAction_PresentationVo) form.dyngrdICP().getSelectedRow().getValue());
	else
		notifySelectedActionChanged(null);
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow createReportRow(TemplateForPatientDocumentVo template) 
{
	if(template == null || template.getReport() == null)
		throw new CodingRuntimeException("Cannot add a row with null template or null report.");
		
	DynamicGridRow reportRow = form.dyngrdReports().getRows().newRow();
	
	reportRow.setValue(template.getReport());
	reportRow.setSelectable(false);
	reportRow.setCollapsedImage(form.getImages().Core.ReportDesigner);
	reportRow.setExpandedImage(form.getImages().Core.ReportDesigner);

	DynamicGridCell cellName = createCell(reportRow, getColumn(COLUMN_NAME));
	
	if(cellName != null)
		cellName.setValue(template.getReport().getReportName());

	if(template.getReport().getImsIdIsNotNull() && template.getReport().getImsId().intValue() > 0)
	{
		reportRow.setTextColor(Color.Blue);
	}
	
	return reportRow;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void selectDynamicRow(DynamicGridRow row)
{
	if (row == null)
		return;

	form.getGlobalContext().Core.setClinicalNotesShort((ClinicalNotesShortVo) form.dyngrdNotes().getValue());

	form.getGlobalContext().Clinical.setCurrentClinicalNote(domain.getClinicalNote((ClinicalNotesShortVo) form.dyngrdNotes().getValue()));

	// WDEV-2511
	/*if (domain.getMosUser() == null)  //commented for WDEV-14624
		{
	clearContextMenu();
		form.getContextMenus().Clinical.getExtendedClinicalNotesVIEWItem().setVisible(true);//WDEV-14624
		return;
	}
	*/ 
	updateContextMenu();
	
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-12569
 * Function used to check for stages not yet configured for the tumour site 
 */
private boolean hasUnconfiguredStages()
{
	// Check for overall value (other values should be populated)
	for (int i = 0; i < form.dyngrdOverall().getRows().size(); i++)
	{
		DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
		DynamicGridRow row = form.dyngrdOverall().getRows().get(i);

		// If the row has an active overall value
		// Use the LiteVo version for value as this is the smallest type of VO
		if (row.getValue() instanceof TumourGroupSiteOverallStagingLiteVo && ((TumourGroupSiteOverallStagingLiteVo)row.getValue()).getIsActive())
		{
			DynamicGridCell cell = row.getCells().get(column);

			// If the value is null or TOBECONFIGURED (-2151) then return as having stages not configured
			if (cell.getValue() == null || TumourOverallStage.TOBECONFIGURED.equals(cell.getValue()))
				return true;
		}
	}

	// All stages are configured
	return false;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addEntityUser()
{
	form.getLocalContext().setUsersEntityAdded(true);
	DynamicGridRow messageRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow();
	if (messageRow != null)
	{
		DynamicGridRow userEntityInstanceRow = messageRow.getRows().newRow();
		DynamicGridColumn userEntityInstanceColl = getColByIndexForActionGrid(0);
		if (userEntityInstanceColl == null)
		{
			userEntityInstanceColl = createColumnForActionGrid("", 0);
		}
		DynamicGridCell userEntityInstanceCell = userEntityInstanceRow.getCells().newCell(userEntityInstanceColl, DynamicCellType.HTMLVIEW);
		userEntityInstanceCell.setAutoPostBack(true);
		userEntityInstanceCell.setWidth(250);
		userEntityInstanceCell.setValue("--- User(s) Entity ---");
		userEntityInstanceRow.setIdentifier(NOTIFICATION_USER_ENTITY_INSTANCE);
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow getAppointmentRow(Booking_AppointmentRefVo appointment)
{
	if(appointment == null || appointment.getID_Booking_Appointment() == null)
		return null;
	
	for(int i=0; i<form.dyngrdNotes().getRows().size(); i++)
	{
		if(form.dyngrdNotes().getRows().get(i).getValue() instanceof BookingAppointmentForClinicalNotesVo
			&& ((BookingAppointmentForClinicalNotesVo) form.dyngrdNotes().getRows().get(i).getValue()).getID_Booking_Appointment() .equals(appointment.getID_Booking_Appointment()))
		{
			return form.dyngrdNotes().getRows().get(i);
		}
	}
	
	return null;
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addTemplates(TemplateForPatientDocumentVo template, DynamicGridRow reportRow)
{
	if(template == null || template.getReport() == null)
		throw new CodingRuntimeException("Cannot add a row with null template or null report.");
	
	if(reportRow == null)
		return;

	DynamicGridRow templateRow = reportRow.getRows().newRow();
	templateRow.setValue(template);
	templateRow.setCollapsedImage(form.getImages().Core.TemplateReport);
	templateRow.setExpandedImage(form.getImages().Core.TemplateReport);

	DynamicGridCell cellTemplateName = createCell(templateRow, getColumn(COLUMN_NAME));
	if(cellTemplateName != null)
		cellTemplateName.setValue(template.getName());

	if(template.getReport().getImsIdIsNotNull() && template.getReport().getImsId().intValue() > 0)
	{
		templateRow.setTextColor(Color.Blue);
	}
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow createReportRow(TemplateForPatientDocumentVo template) 
{
	if(template == null || template.getReport() == null)
		throw new CodingRuntimeException("Cannot add a row with null template or null report.");
		
	DynamicGridRow reportRow = form.lyrLetterCreate().tabTemplate().dyngrdReports().getRows().newRow();
	
	reportRow.setValue(template.getReport());
	reportRow.setSelectable(false);
	reportRow.setCollapsedImage(form.getImages().Core.ReportDesigner);
	reportRow.setExpandedImage(form.getImages().Core.ReportDesigner);
	reportRow.setExpanded(true);//WDEV-13991

	DynamicGridCell cellName = createCell(reportRow, getColumn(COLUMN_NAME));
	
	if(cellName != null)
		cellName.setValue(template.getReport().getReportName());

	if(template.getReport().getImsIdIsNotNull() && template.getReport().getImsId().intValue() > 0)
	{
		reportRow.setTextColor(Color.Blue);
	}
	
	return reportRow;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public PatientAssessmentVo updateNotApplicableQuestionStatus(PatientAssessmentVo voPatientAssessment)
{
	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);

		AssessmentQuestionVo question = (AssessmentQuestionVo) row.getIdentifier();
		PatientAssessmentQuestionVo answer = findAnswer(voPatientAssessment.getAssessmentData().getAnswerGroups(), question);
		if (answer == null)
			throw new CodingRuntimeException("Unable to find an answer for '" + question.getQuestion().getText() + "' question.");
		// Change the status from Non Applicable to Answered
		if (isAnswerStatus(answer, AnswerStatus.NOTAPPLICABLE))
		{
			DynamicGridColumn columnNASelect = this.grid.getColumns().getByIdentifier(SELECT_NA_COLUMN);
			if (columnNASelect != null)
			{
				DynamicGridCell cellNASelect = row.getCells().get(columnNASelect);
				if (cellNASelect.getValue() instanceof Boolean && ((Boolean) cellNASelect.getValue()).booleanValue())
					answer.setIsAnswered(AnswerStatus.ANSWERED);
			}
		}
	}

	return voPatientAssessment;
}
 
Example 19
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow findRow(DynamicGridRow groupRow, Assessment_QuestionVo assessmentQuestion)
{
	if(assessmentQuestion == null)
		return null;
	
	DynamicGridRowCollection rows = null;
	if(groupRow != null)
		rows = groupRow.getRows();
	else
		rows = this.grid.getRows();
	
	for(int x = 0; x < rows.size(); x++)
	{
		DynamicGridRow row = rows.get(x);
		if(row.getIdentifier() != null && row.getIdentifier() instanceof Assessment_QuestionVo)
		{
			if(row.getIdentifier().equals(assessmentQuestion))
				return row;
		}
	}
	
	return null;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addSpecialitiesRow(DynamicGridRow pRow, SpecialtyCollection specialty)
{
	if (specialty == null)
		return;

	for (int i = 0; i < specialty.size(); i++)
	{
		Specialty spe = specialty.get(i);
		DynamicGridRow nRow = pRow.getRows().newRow();

		nRow.setIdentifier(SPECIALTY_ROW_IDENTIFIER);
		nRow.setCollapsedImage(form.getImages().Admin.Specialty01);
		nRow.setExpandedImage(form.getImages().Admin.Specialty01);

		DynamicGridCell nCell = nRow.getCells().newCell(getColumn(form.lyrMain().tabByCategory().dyngrdMapps(), COLUMN_NAME), DynamicCellType.ENUMERATION);
		nCell.setReadOnly(false);
		nCell.setAutoPostBack(true);
		nCell.getItems().newItem(spe);
		nCell.setValue(spe);
	}
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addNewPrescriptionRecord()
{
	if (form.getLocalContext().getPrescriptionRecordAddedIsNotNull() && !form.getLocalContext().getPrescriptionRecordAdded())
	{
		form.getLocalContext().setPrescriptionRecordAdded(true);
		form.setMode(FormMode.EDIT);
		DynamicGridRow row = null;
		if (form.dyngrdPrescription().getRows().size() == 0)
		{
			row = form.dyngrdPrescription().getRows().newRow(true);
		}
		else
		{
			row = form.dyngrdPrescription().getRows().newRowBefore(form.dyngrdPrescription().getRows().get(0), true);
		}
		
		addNewPrescriptionRecord(row, null, true);
	}
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 *	WDEV-13184
 *	Function used to retrieve Referral records from grid
 */
private CatsReferralListManualAssemblyVoCollection populateReferralsFromGrid()
{
	// Records collection
	CatsReferralListManualAssemblyVoCollection records = new CatsReferralListManualAssemblyVoCollection();
	
	// Iterate grid rows and add their values to collection
	for (int i = 0; i < form.dyngrdReferrals().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdReferrals().getRows().get(i);
		
		if (row.getValue() instanceof CatsReferralListManualAssemblyVo)
			records.add((CatsReferralListManualAssemblyVo) row.getValue());
	}
	
	// Return records collection
	return records;
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkDatasets()
{
	if(form.dyngrdLinkedDataSets().getRows().size() == 0)
	{
		engine.showMessage("Please add at least a dataset !");
		return false;
	}

	for (int i = 0; i < form.dyngrdLinkedDataSets().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdLinkedDataSets().getRows().get(i);
		
		if(row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_ANSWERBOX)).getValue().equals(LineTypeStatus.CUSTOM))
		{
			if(row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_LINETYPE)).getValue() == null)
			{
				engine.showMessage("Please set a line type for dataset " + ((DataSetTypeVo)row.getValue()).getName() + " !");
				return false;
			}
			if(row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_COLOR_ICON)).getValue() == null)
			{
				engine.showMessage("Please set a Colour / Icon for dataset " + ((DataSetTypeVo)row.getValue()).getName() + " !");
				return false;
			}
		}
	}
	
	return true;
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * function used to populate dynamic grid row with root finding (backward
 * compatibility)
 */
private void setDynamicGridRootFindingRow(DynamicGridRow row, NeuroMotorRootValueVo 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.getRootValue() != null ? finding.getRootValue().getDescription() : "");
	cell.setIdentifier(finding.getRootValue());
	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 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow getGroupRow(IChartValueGroup group)
{
	for(int x = 0; x < getGrid().getRows().size(); x++)
	{
		if(group.equals(getGrid().getRows().get(x).getIdentifier()))
			return getGrid().getRows().get(x);
	}
	
	return null;
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setCareContextIfApplicable(DynamicGridRow row)
{
	if(row.getIdentifier() instanceof PASEventRefVo)
		form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent((PASEventRefVo) row.getIdentifier()));	
	else
		form.getGlobalContext().Core.setCurrentCareContext(null);
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateDose()
{
	DynamicGridRow doseRow = form.dyngrdDoses().getSelectedRow();
	
	if (doseRow == null)
		return;
	
	DynamicGridCell cellDose = doseRow.getCells().get(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSENAME));
	cellDose.setReadOnly(false);
	
	DynamicGridCell cellRoute = doseRow.getCells().get(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE));
	cellRoute.setReadOnly(false);
	
	doseRow.setIdentifier(ROW_STATE_EDITABLE);
}
 
Example 28
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 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void refreshQuestionsInGroupCollectionFromScreenMultipleGroupNoFlat(ims.core.vo.QuestionInformationVoCollection editedQuestions)
{
	if(editedQuestions == null || editedQuestions.size() == 0)
		return;
	
	for(int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i);
		
		for (int j = 0; j < row.getRows().size(); j++)
		{
			refreshQuestionInGrid(editedQuestions, row.getRows().get(j));
		}
	}		
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeQuestion()
{
	DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getSelectedRow();
	if(row != null)
	{
		form.lyrTabs().tabAssessments().dyngrdDetails().getRows().remove(row);
		refreshContextMenu();	
	}
	else
	{
		engine.showMessage("Please select a Question");
	}
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateProfileType(DynamicGridRow parentRow) 
{
	parentRow.getRows().clear();
	
	DynamicGridRow childConsultantRow = parentRow.getRows().newRow();
	DynamicGridColumn column = null;
	DynamicGridCell cell = null;
	
	column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_IMAGE);
	cell = childConsultantRow.getCells().newCell(column, DynamicCellType.IMAGE);
	cell.setValue(form.getImages().Core.Users);
	column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_HEADING);
	cell = childConsultantRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(ProfileType.CONSULTANT.toString());
	cell.setReadOnly(true);
	childConsultantRow.setValue(ProfileType.CONSULTANT);
	childConsultantRow.isReadOnly();
	populateGlossaryProfile(parentRow, childConsultantRow, form.getImages().Core.User);
	
	DynamicGridRow childSpecialtyRow = parentRow.getRows().newRow();
	
	column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_IMAGE);
	cell = childSpecialtyRow.getCells().newCell(column, DynamicCellType.IMAGE);
	cell.setValue(form.getImages().Admin.Specialty);
	column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_HEADING);
	cell = childSpecialtyRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(ProfileType.SPECIALTY.toString());
	cell.setReadOnly(true);
	childSpecialtyRow.setValue(ProfileType.SPECIALTY);
	childSpecialtyRow.isReadOnly();
	populateGlossaryProfile(parentRow, childSpecialtyRow, form.getImages().Admin.Specialty2);
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private ChartTypeVo populateDataFromScreenLocal()
{
	ChartTypeVo record = populateDataFromScreen(form.getLocalContext().getCurrentRecord());

	record.setNormalBandColour(form.cmbNormalColour().getValue());
	
	if(record.getDatasetTypes() == null)
		record.setDatasetTypes(new ChartTypeDatasetVoCollection());
	else
		record.getDatasetTypes().clear();
	
	int order = 1;	//WDEV-12548
	
	for (int i = 0; i < form.dyngrdLinkedDataSets().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdLinkedDataSets().getRows().get(i);
		
		ChartTypeDatasetVo item = new ChartTypeDatasetVo();
		item.setDatasetType((DataSetTypeVo)row.getValue());
		
		if(row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_ANSWERBOX)).getValue().equals(LineTypeStatus.CUSTOM))
		{
			item.setLineType((LineType) row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_LINETYPE)).getValue());
			item.setLineColourPointIcon((LineColourPointIcon) row.getCells().get(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_COLOR_ICON)).getValue());
		}
		
		item.setSortOrder(Integer.valueOf(order++)); //WDEV-12548
		
		record.getDatasetTypes().add(item);
	}
	
	return record;
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void checkIfThereAreSameIdentifier(PatientIdCollection identifiers,	DynamicGridRow parentRow, DynamicGridColumn column) 
{
	if(identifiers == null || identifiers.size() == 0 || parentRow == null)
		return;
	
	for(int j = identifiers.size() - 1; j>=0; j--)
	{
		if(identifiers.get(j) == null)
			continue;
		
		for(int i=0; i<parentRow.getRows().size(); i++)
		{
			if(parentRow.getRows().get(i).getValue().equals(identifiers.get(j).getType()))
			{
				DynamicGridCell sourceIdentifierValueCell = parentRow.getRows().get(i).getCells().get(getColumn(COL_SOURCE_PATIENT));
				
				if(sourceIdentifierValueCell != null && sourceIdentifierValueCell.getValue() != null)
				{
					String destinationIdentifierValue = formatIdentifierValue(identifiers.get(j).getValue());
					
					if(sourceIdentifierValueCell.getValue().equals(destinationIdentifierValue))
					{
						DynamicGridCell cellNew = parentRow.getRows().get(i).getCells().newCell(column, DynamicCellType.STRING);
						cellNew.setValue(getColumn(COL_RESULT_DATA).equals(column) ? destinationIdentifierValue : identifiers.get(j).getValue());
						cellNew.setReadOnly(true);
					
						identifiers.remove(j);
						break;
					}
				}
			}
		}
	}
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onDyngrdWhiteBoardRowSelectionChanged(DynamicGridRow row) throws PresentationLogicException
{
	System.out.println("Row Selection");
	setGlobalContexts((TrackingForClinicianWorklistAndTriageVo)form.dyngrdWhiteBoard().getValue());
	engine.open(form.getForms().Emergency.EDWhiteBoardEditDialog, new Object[] {form.cmbArea().getValue(),form.cmbStatus().getValue()});
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void refreshRecord(SpecimenWorkListItemListVo specimenWorkListItemList)
{
	if(specimenWorkListItemList != null && specimenWorkListItemList.getCollectionStatus().equals(SpecimenCollectionStatus.MOVEDTOPHLEBOTOMY))
	{
		DynamicGridRow row = form.dyngrdCollect().getSelectedRow();
		if(row != null)
		{
			//WDEV-2990 - clear existing cell and then set the value to the selected row 
			clearVariableCells(row);
			removeCommonCells(row);
			displayCommonCells(specimenWorkListItemList, row);
			row.setValue(specimenWorkListItemList);
		}
	}
}
 
Example 36
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 37
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow getRowByIdentifier(Patient_GraphicAssessmentFindingQuestionAnswerVo graphicFindingQuestionAnswer)
{
	if(graphicFindingQuestionAnswer == null)
		return null;

	for(int x = 0; x < this.grid.getRows().size(); x++)
	{	
		Patient_GraphicAssessmentFindingQuestionAnswerVo findingAnswer = (Patient_GraphicAssessmentFindingQuestionAnswerVo)(this.grid.getRows().get(x).getCells().get(this.grid.getColumns().getByIdentifier(QUESTION_COLUMN)).getIdentifier());
		if(graphicFindingQuestionAnswer.equals(findingAnswer))
			return this.grid.getRows().get(x);
	}
	
	return null;
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onDyngrdCCOCyclesDaysRowSelectionChanged(DynamicGridRow row) throws PresentationLogicException
{
	populateCCOCycleControls(row.getValue());
	form.getLocalContext().setSelectedCCOChemoCycleDetails((ChemoCycleDetailsCCOVo) row.getValue());
	updateContextMenuState();
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void ListPrioritiesCounts(ILocation currentLocation,TrackingAreaVoCollection areas, String priority, TriagePriority lookup_inst_id)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue(priority);
	cell.setBackColor(Color.fromRGB(198, 223, 242));
	
	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getPriorityXCounts(currentLocation, areas.get(i),lookup_inst_id);
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
			
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");
	cell.setBackColor(Color.Bisque);
}
 
Example 40
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow getRowsByIdentifier(Patient_GraphicAssessmentQuestionAnswerVo voPatientGAQAnswer)
{
	for(int x = 0; x < this.grid.getRows().size(); x++)
	{	
		Patient_GraphicAssessmentQuestionAnswerVo questionAnswer = (Patient_GraphicAssessmentQuestionAnswerVo)(this.grid.getRows().get(x).getCells().get(this.grid.getColumns().getByIdentifier(QUESTION_COLUMN)).getIdentifier());
		if(voPatientGAQAnswer.equals(questionAnswer))
			return this.grid.getRows().get(x);
	}
	
	return null;
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateAssociation(TemplateAssociationsVo templateAssociations)
{
	form.dyngrdAssociations().getRows().clear();
	
	
	// Iterate through all the associations categories and add them to the grid
	for (AssociationCategory association : AssociationCategory.values())
	{
		// Create a new row
		DynamicGridRow newRow = newCategoryAssociationsGridRow(association);
		newRow.setExpanded(true);
		
		// Populate the categories
		if (templateAssociations == null)
			continue;
		
		switch (association)
		{
			case CLINICS:
				populateClinicAssociations(newRow, templateAssociations.getClinics());
				break;
				
			case CONSULTANTS:
				populateConsultantAssociations(newRow, templateAssociations.getConsultants());
				break;
				
			case SPECIALTY:
				populateSpecialtyAssociations(newRow, templateAssociations.getSpecialties());
				break;
		}
	}
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSpecialtyAssociations(DynamicGridRow parrentRow, SpecialtyCollection specialties)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add Clinical association rows to null parent row");
	
	if (specialties == null)
		return;
	
	for (int i = 0; i < specialties.size(); i++)
	{
		newSpecialtyAssociationRow(parrentRow, specialties.get(i));
	}
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridCell createCell(DynamicGridRow row, DynamicGridColumn column)
{
	if(row == null || column == null)
		return null;
	
	DynamicGridCell cell = row.getCells().get(column);
	if (cell == null)
	{
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setReadOnly(true);
	}

	return cell;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void refreshQuestionInGrid(ims.core.vo.QuestionInformationVoCollection editedQuestions, DynamicGridRow childRow)
{
	if(childRow.getValue() instanceof AssessmentQuestionVo)
	{
		AssessmentQuestionVo value = (AssessmentQuestionVo) childRow.getValue();
		ims.core.vo.QuestionInformationVo voQuestion = value.getQuestion();
		int index = editedQuestions.indexOf(voQuestion);
		if(voQuestion != null && index >= 0)
		{
			value.setQuestion(editedQuestions.get(index));
			childRow.setValue(value);
		}
	}
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newClinicAssociation(DynamicGridRow parrentRow)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a CLINIC association to a null parrent row");
	
	if (!(parrentRow.getValue() instanceof AssociationCategory) || ((AssociationCategory) parrentRow.getValue()) != AssociationCategory.CLINICS)
		throw new CodingRuntimeException("Logical Error - Function must be called from CLINICS category row only");
	

	parrentRow.setExpanded(true);
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow(true);
	newRow.setValue(new ClinicLiteVo());
	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().Admin.Clinic01);
	
	// 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 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private ArrayList<String> validateActionRow(DynamicGridRow row, ArrayList<String> errors)
{
	if (row.getIdentifier() instanceof RulesEngineEntityMethod)
	{
		validateRulesEngineEntityMethodRow(row, errors);
	}
	else if (row.getIdentifier() != null && row.getIdentifier().equals(NOTIFICATION))
	{
		// TODO Validate NOTIFICATION
		
		// Check user row
		validateSendNotificationUserRow(row, errors);
		
		// Check message row
		validateSendNotificationMessageRow(row, errors);
		
		// Check options row
		DynamicGridRow optionsRow = row.getRows().get(2);
		
		for (int i = 0; i < optionsRow.getRows().size(); i++)
		{
			if (!(optionsRow.getRows().get(i).getIdentifier() instanceof NotificationPriority))
			{
				errors.add("Priority for Send Notification action is mandatory");
			}
		}
	}
	else if (row.getIdentifier() instanceof String)
	{
		DynamicGridRow childRow = row.getRows().get(0);
		
		if (childRow.getCells().get(getColByIndexForActionGrid(1)).getValue() == null)
			errors.add("Message for Rule Action Data Validation Error action is mandatory");
	}

	return errors;
}
 
Example 47
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.WRAPTEXT);
		cell.setReadOnly(true);
	}

	return cell;
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow getWardForPatient(SpecimenWorkListitemCustomVo item)
{
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		if (form.dyngrdCollect().getRows().get(i).getValue().equals(item.getWardId()))
		{
			return form.dyngrdCollect().getRows().get(i);
		}
	}

	return null;
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow addRow(DynamicGridRow parent,LookupInstVo look, int depth)
{
	if (look == null)
		throw new CodingRuntimeException("Trying to add null value lookup instance");
	DynamicGridRow result ;
	if (parent == null)
		result =  form.dyngrdLookup().getRows().newRow();
	else
		result = parent.getRows().newRow();
	
	result.setSelectable(isSingleSelect());
	result.setCollapsedImage(null);
	result.setExpandedImage(null);
	DynamicGridCell nCell;
	if (!isSingleSelect())
	{
		DynamicGridColumn colSel = getColumn(COL_SELECT);
		if (colSel.getWidth() < depth * SELECT_WIDTH_N)
			colSel.setWidth(depth * SELECT_WIDTH_N);
		nCell = result.getCells().newCell(colSel,DynamicCellType.BOOL);
		nCell.setAutoPostBack(false);
		nCell.setReadOnly(false);
	}
	
	nCell = result.getCells().newCell(getColumn(COL_TXT), DynamicCellType.STRING);
	nCell.setAutoPostBack(false);
	nCell.setReadOnly(true);
	nCell.setValue(look.getText());
	
	result.setValue(look);
	
	return result;
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addSubcategories(DynamicGridRow rowParent, ReportsCategoryListVoCollection voReportsCategoryColl)
{
	for (int i = 0; i < voReportsCategoryColl.size(); i++)
	{
		addCategory(rowParent, voReportsCategoryColl.get(i));
	}
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void clearVariableCells(DynamicGridRow row)
{
	removeCellByColumn(row, DATE_COL);
	removeCellByColumn(row, TIME_COL);
	removeCellByColumn(row, QUERY_COL);
	removeCellByColumn(row, TEXT_COL);
}
 
Example 52
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   Source Code and License 5 votes vote down vote up
private void populateRoleGridFromScreenMultipleGroupFlat()
{
	for (int i = 0; dynGridDetails != null && i < dynGridDetails.getRows().size(); i++)
	{
		DynamicGridRow row = dynGridDetails.getRows().get(i);

		if (row.getValue() instanceof AssessmentQuestionVo)
		{
			AssessmentQuestionVo value = (AssessmentQuestionVo) row.getValue();
			updateAssessmentQuestionData(row, value);
			addRoleQuestionToGrid(value, row);
		}
	}
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private QuestionInformationShortVo getQuestionFromGridRow(DynamicGridRow row)
{
	if (row != null)
	{
		DrawingGraphicFindingQuestionVo voDGFindingQuestion = getRowValue(row);
		return (QuestionInformationShortVo) (voDGFindingQuestion != null ? voDGFindingQuestion.getQuestion().clone() : null);
	}
	return null;
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentDataListVo getSelectedPatientAssessmentData()
{
	DynamicGridRow row = form.dyngrdAssessments().getSelectedRow();
	if(row != null)
	{
		PatientAssessmentListVo voPatientAssessmentList = getSelectedPatientAssessment(row);
		if(voPatientAssessmentList != null)
		{
			return voPatientAssessmentList.getAssessmentData();
		}
	}
	
	return null;
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void uncheckOthers(DynamicGridRow row) 
{
	if(row == null)
		return;
	
	for(int i=0; i<form.dyngrdDepartments().getRows().size(); i++)
	{
		if(!form.dyngrdDepartments().getRows().get(i).equals(row))
		{
			form.dyngrdDepartments().getRows().get(i).getCells().get(getSelectedColumn(COLDEFAULT)).setValue(false);
		}
	}
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createMoveButtons(DynamicGridRow row) 
{
	DynamicGridCell sourceCell = row.getCells().get(getColumn(COL_SOURCE_PATIENT));
	DynamicGridCell destinationCell = row.getCells().get(getColumn(COL_DESTINATION_PATIENT));
	if((sourceCell != null && sourceCell.getValue() != null) || (destinationCell != null && destinationCell.getValue() != null) || PatientMergeFields.NAME.equals(row.getValue()) || PatientMergeFields.ADDRESS.equals(row.getValue()) || PatientMergeFields.COMMUNICATION_CHANNELS.equals(row.getValue()))
	{
		DynamicGridCell cell = row.getCells().newCell(getColumn(COL_SOURCE_BUTTONS), DynamicCellType.IMAGEBUTTON);
		cell.setValue(form.getImages().Core.UseSource);
		cell.setTooltip(SOURCE_BUTTON_TEXT);
		
		cell = row.getCells().newCell(getColumn(COL_DESTINATION_BUTTONS), DynamicCellType.IMAGEBUTTON);
		cell.setValue(form.getImages().Core.UseDestination);
		cell.setTooltip(DESTINATION_BUTTON_TEXT);
	}
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void showHistoryButtonForCareContextInGrid()
{
	CareContextRefVoCollection refCareContextColl = form.getLocalContext().getCareContextCollection();
	if (refCareContextColl != null && refCareContextColl.size() > 0)
	{
		DynamicGridRow[] rowVectColl = getAllRows(form.dyngrdList().getRows());
		for (int k = 0; k < rowVectColl.length; k++)
		{
			if (rowVectColl[k].getValue() instanceof CareContextVo)
			{
				CareContextVo voCare = (CareContextVo) rowVectColl[k].getValue();
				for (int i = 0; i < refCareContextColl.size(); i++)
				{
					if (voCare != null && voCare.getID_CareContextIsNotNull() && voCare.getID_CareContext().equals(refCareContextColl.get(i).getID_CareContext()))
					{
						DynamicGridColumn historyColum = getColumnById(COLUMN_HISTORY);
						if (historyColum != null)
						{
							DynamicGridCell cellHistory = rowVectColl[k].getCells().newCell(historyColum, DynamicCellType.BUTTON);
							cellHistory.setValue("");
							cellHistory.setTooltip("History");
						}
					}
				}
			}
		}
	}
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isPrimaryPracticeMarked()
{
	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 cell = pRow.getCells().get(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRIMARY));
		if (cell != null && cell.getValue() != null && cell.getValue().equals(Boolean.TRUE))
			return true; 
	}
	return false;
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateScreenFromData(AwaitingClinicalInfoVo awaitingClinicalInfo)
{
	clearScreen();

	if (awaitingClinicalInfo == null)
		return;

	// Populate date control for awaiting clinical information date
	form.dtimAwaitingInformation().setValue(awaitingClinicalInfo.getDateAwaitingClinicalInfo());

	// Populate dynamic grid data
	boolean checkAwaitingClinicalInfo = awaitingClinicalInfo.getClinicalInfoAwaitingIsNotNull();
	boolean checkReceivedClinicalInfo = awaitingClinicalInfo.getClinicalInfoReceivedIsNotNull();

	for (int i = 0; i < form.dyngrdClinInfo().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdClinInfo().getRows().get(i);

		if (row.getValue() == null)
			continue;

		if (checkAwaitingClinicalInfo && awaitingClinicalInfo.getClinicalInfoAwaiting().contains((AwaitingClinicalInformationType) row.getValue()))
			row.getCells().get(getColumn(COLAWAIT)).setValue(form.getImages().Core.Tick);

		if (checkReceivedClinicalInfo && awaitingClinicalInfo.getClinicalInfoReceived().contains((AwaitingClinicalInformationType) row.getValue()))
			row.getCells().get(getColumn(COLREC)).setValue(form.getImages().Core.Tick);
	}

	// Set other information text
	form.txtOther().setValue(awaitingClinicalInfo.getOtherClinicalInformation());

	// Populate date control for a all clinical information received
	form.dtimInformationReceived().setValue(awaitingClinicalInfo.getDateClinicalInfoReceived());
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientAssessmentListVo getSelectedPatientAssessment(DynamicGridRow row)
{
	if (row == null)
		return null;

	Object value = row.getValue();
	if (value instanceof PatientAssessmentListVo)
		return (PatientAssessmentListVo) value;

	return null;
}