Java Code Examples for ims.framework.controls.DynamicGridRowCollection.size()

The following are Jave code examples for showing how to use size() of the ims.framework.controls.DynamicGridRowCollection class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private TemplateBoRefVoCollection getTemplateBoRefFromMappGrid()
{
	DynamicGridRowCollection rows = form.lyrMain().tabByCategory().dyngrdMapps().getRows();
	if (rows.size() == 0)
		return null;

	TemplateBoRefVoCollection result = new TemplateBoRefVoCollection();
	for (int i = 0; i < rows.size(); i++)
	{
		if (rows.get(i).getValue() instanceof DocumentCategoryConfigShortVo)
		{
			result.add(((DocumentCategoryConfigShortVo) rows.get(i).getValue()).getTemplate());
		}
	}

	return result;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void addAllAvailable()
{
	tabByCategoryContainer tab = form.lyrMain().tabByCategory();

	for (int i = 0; i < tab.dyngrdAvailableRep().getRows().size(); i++)
	{
		DynamicGridRowCollection templates = tab.dyngrdAvailableRep().getRows().get(i).getRows();
		if (templates != null)
		{
			for (int j = 0; j < templates.size(); j++)
			{
				DocumentCategoryConfigShortVo docCat = new DocumentCategoryConfigShortVo();
				docCat.setTemplate((TemplateForPatientDocumentVo) templates.get(j).getValue());
				docCat.setCategory(tab.grdDocCat().getValue());
				addRowToMappGrid(docCat);
			}

		}
	}

	tab.dyngrdAvailableRep().getRows().clear();
	updateControlsState();
}
 
Example 3
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License Vote up 6 votes
private DynamicGridRow findLastRowWithSameIdentifier(DynamicGridRowCollection rows, Object identifier)
{
	if(rows == null || identifier == null)
		return null;
	
	DynamicGridRow lastRow = null;		
	for(int x = 0; x < rows.size(); x++)
	{
		if(identifier.equals(rows.get(x).getIdentifier()))
		{
			lastRow = rows.get(x);
		}
	}
	
	return lastRow;
}
 
Example 4
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License Vote up 6 votes
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 5
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private DynamicGridRow[] getAllRows(DynamicGridRowCollection rows)
{
	java.util.ArrayList returnRows = new java.util.ArrayList();
	for(int x = 0; x < rows.size(); x++)
	{
		DynamicGridRow row = rows.get(x);
		returnRows.add(row);
		
		DynamicGridRow[] childRows = getAllRows(row);
		for(int i = 0; i < childRows.length; i++)
		{
			returnRows.add(childRows[i]);
		}
	}
	
	DynamicGridRow[] result = new DynamicGridRow[returnRows.size()];
	for(int x = 0; x < returnRows.size(); x++)
	{
		result[x] = (DynamicGridRow) returnRows.get(x);
	}
	
	return result;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private MedicationRouteVoCollection getRoutes(DynamicGridRowCollection rows)
{
	if (rows == null)
		return null;
	MedicationRouteVoCollection result = new MedicationRouteVoCollection();
	for (int i = 0 ; i < rows.size() ; i++)
	{
		if (rows.get(i).getValue() instanceof MedicationRouteVo)
		{
			MedicationRouteVo x = (MedicationRouteVo) rows.get(i).getValue();
			x.setRouteUnits(getUnits(rows.get(i).getRows()));
			if (x.getRouteIsNotNull() || x.getRouteUnitsIsNotNull())
			{
				result.add(x);
			}
		}
	}
	if (result.size() == 0)
		return null;
	return result;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
private DynamicGridRow[] getAllRows(DynamicGridRowCollection rows)
{
	java.util.ArrayList returnRows = new java.util.ArrayList();
	for(int x = 0; x < rows.size(); x++)
	{
		DynamicGridRow row = rows.get(x);
		returnRows.add(row);
		
		DynamicGridRow[] childRows = getAllRows(row);
		for(int i = 0; i < childRows.length; i++)
		{
			returnRows.add(childRows[i]);
		}
	}
	
	DynamicGridRow[] result = new DynamicGridRow[returnRows.size()];
	for(int x = 0; x < returnRows.size(); x++)
	{
		result[x] = (DynamicGridRow) returnRows.get(x);
	}
	
	return result;
}
 
Example 8
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 6 votes
private boolean verifyDateinRows(List<String> uiErrors, DynamicGridRowCollection rows, boolean foundBadExpiry)
{
	for (int i = 0; i < rows.size(); i++)
	{
		if (!(rows.get(i).getValue() != null && ((ValueObjectRef) rows.get(i).getValue()).getBoId() != null))
		{

			DynamicGridCell[] cellArray = rows.get(i).getCellArray();
			if (cellArray[2].getValue() != null && ((Date) cellArray[2].getValue()).isLessThan(new Date()))
			{
				uiErrors.add("Expiry Date can't be in the past");
				foundBadExpiry = true;
				break;
			}
		}
	}
	return foundBadExpiry;
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
private BayConfigForWardViewVoCollection getSelectedBaysForBlock()
{
	DynamicGridRowCollection grdBayRows = form.lyrDetails().tabBlockB().dyngrdBaysForBlock().getRows();
	BayConfigForWardViewVoCollection bays = new BayConfigForWardViewVoCollection();
	for (int i=0;i<grdBayRows.size();i++)
	{
		if (grdBayRows.get(i) == null || grdBayRows.get(i).getValue() == null || !(grdBayRows.get(i).getValue() instanceof BayConfigForWardViewVo))
			continue;
		if (Boolean.TRUE.equals(grdBayRows.get(i).getCells().get(getColumnBay(COLUMN_BAY_SELECT_BLOCK, form.lyrDetails().tabBlockB().dyngrdBaysForBlock())).getValue()))
		{	
			BayConfigForWardViewVo gridValue = (BayConfigForWardViewVo)grdBayRows.get(i).getValue();
			bays.add((BayConfigForWardViewVo) gridValue.clone());
		}
	}
	return bays;

}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
private DynamicGridRow findLastRowWithSameIdentifier(DynamicGridRowCollection rows, Object identifier)
{
	if (rows == null || identifier == null)
		return null;

	DynamicGridRow lastRow = null;
	for (int x = 0; x < rows.size(); x++)
	{
		if (identifier.equals(rows.get(x).getIdentifier()))
		{
			lastRow = rows.get(x);
		}
	}

	return lastRow;
}
 
Example 11
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 6 votes
private DynamicGridRow findRow(DynamicGridRow groupRow, AssessmentQuestionVo 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 AssessmentQuestionVo)
		{
			if (row.getIdentifier().equals(assessmentQuestion))
				return row;
		}
	}

	return null;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void clearPrimaryLocations(DynamicGridRowCollection rows)
{
	for(int i = 0 ; i < rows.size() ; i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() instanceof OrganisationVo == false)
			row.setTextColor(Color.Default);
		
		if(row.getRows() != null && row.getRows().size() > 0)
			clearPrimaryLocations(row.getRows());
	}
	form.dyngrdOrganisationLocation().getRows().expandAll();	
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void addClinicAssociationsToTemplate(ClinicLiteVoCollection clinics, DynamicGridRowCollection rows)
{
	// NOTE: DO NOT make clinics = new ClinicLiteVoCollection() in this function
	// clinics MUST ALWAYS reference the clinics in the TemplateAssociationVo
	
	if (rows == null)
		return;
	
	if (clinics == null)
		throw new CodingRuntimeException("Logical Error - Inserting values into null CLINICS collection");
	
	
	// Add the records from the grid
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof ClinicLiteVo))
			throw new CodingRuntimeException("Major Logical Error - Non Clinical association added to CLINICS category association");
		
		updateClinicAssociationRowValue(row);
		
		ClinicLiteVo clinicAssociation = (ClinicLiteVo) row.getValue();
		
		if (clinicAssociation != null)
			clinics.add(clinicAssociation);
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void addConsltantAssociationsToTemplate(MedicLiteVoCollection consultants, DynamicGridRowCollection rows)
{
	// NOTE: DO NOT make consultants = new MedicLiteVoCollection() in this function
	// consultants MUST ALWAYS reference the consultants in the TemplateAssociationVo
	
	if (rows == null)
		return;
	
	if (consultants == null)
		throw new CodingRuntimeException("Logical Error - Inserting values into null CONSULTANTS collection");
	

	// Add the records from the grid
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof MedicLiteVo))
			throw new CodingRuntimeException("Major Logical Error - Non Consultant association added to CONSULTANT category association");
		
		updateConsultantAssociationRowValue(row);
		
		MedicLiteVo consultantAssociation = (MedicLiteVo) row.getValue();
		
		if (consultantAssociation != null)
			consultants.add(consultantAssociation);
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private ReferralApptStatusCollection getChildNodes(DynamicGridRow selectedRow)
{
	ReferralApptStatusCollection refColl = new ReferralApptStatusCollection();
	DynamicGridColumn col = form.dyngrdStatus().getColumns().get(0);
	DynamicGridCell[] cells = col.getCellArray();
	DynamicGridRowCollection rows = selectedRow.getRows();
	
				for (int i = 0; i <rows.size(); i++)
				{
					refColl.add((ReferralApptStatus) rows.get(i).getCells().get(col).getValue());
				}
	return refColl;
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private DocumentCategoryConfigShortVoCollection populateDataFromScreenDC()
{
	DynamicGridRowCollection rows = form.lyrMain().tabByCategory().dyngrdMapps().getRows();
	DynamicGridColumn colSpec = getColumn(form.lyrMain().tabByCategory().dyngrdMapps(), COLUMN_NAME);
	if (rows.size() == 0)
		return null;
	DocumentCategoryConfigShortVoCollection result = new DocumentCategoryConfigShortVoCollection();

	for (int i = 0; i < rows.size(); i++)
	{
		DocumentCategoryConfigShortVo docCat = (DocumentCategoryConfigShortVo) rows.get(i).getValue();
		docCat.setSpecialty(null);

		DynamicGridRowCollection specR = rows.get(i).getRows();
		if (specR != null && specR.size() > 0)
		{
			docCat.setSpecialty(new SpecialtyCollection());
			for (int j = 0; j < specR.size(); j++)
			{
				Object spec = specR.get(j).getCells().get(colSpec).getValue();
				if (spec instanceof Specialty)
				{
					docCat.getSpecialty().add((Specialty) spec);
				}
			}
		}
		result.add(docCat);
	}

	return result;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private DynamicGridRow getReportRow(DynamicGridRowCollection parentRows, ReportListVo voReportList)
{
	if (parentRows == null)
		return null;

	for (int i = 0; i < parentRows.size(); i++)
	{
		DynamicGridRow dynamicGridRow = parentRows.get(i);
		Object value = dynamicGridRow.getValue();
		if (value instanceof ReportsCategoryListVo)
		{
			ReportsCategoryListVo voReportsCategory = (ReportsCategoryListVo) value;
			if (voReportsCategory.getReports().indexOf(voReportList) >= 0)
			{
				return dynamicGridRow;
			}
		}

		if (dynamicGridRow.getRows() != null && dynamicGridRow.getRows().size() > 0)
		{
			DynamicGridRow row = getReportRow(dynamicGridRow.getRows(), voReportList);
			if (row != null)
				return row;
		}
	}

	return null;
}
 
Example 18
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License Vote up 5 votes
private DynamicGridRow findFirstRowWithSameIdentifier(DynamicGridRowCollection rows, Object identifier)
{
	if(rows == null || identifier == null)
		return null;
			
	for(int x = 0; x < rows.size(); x++)
	{
		if(identifier.equals(rows.get(x).getIdentifier()))
		{
			return rows.get(x);
		}
	}
	
	return null;
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void rebindFormRows()
{
	DynamicGridRowCollection rows = form.lyrDetails().tabFRU().dyngrdFRU().getRows();
	DoseFormIndicatorCollection mForms = ims.clinical.vo.lookups.LookupHelper.getDoseFormIndicator(this.domain.getLookupService());
	for (int i = 0 ; i < rows.size() ; i++)
	{
		if (rows.get(i).getValue() instanceof MedicationFormVo)
		{
			MedicationFormVo x = (MedicationFormVo) rows.get(i).getValue();
			if (!x.getFormIsNotNull())
				continue;
			mForms.remove(x.getForm());
		}	
	}
	for (int i = 0 ; i < rows.size() ; i++)
	{
		DynamicGridCell cell = rows.get(i).getCells().get(form.lyrDetails().tabFRU().dyngrdFRU().getColumns().getByIdentifier(COL_MAIN));
		Object back = cell.getValue();
		cell.getItems().clear();
		if (back!=null)
			cell.getItems().newItem(back);
		for (int j = 0 ; j < mForms.size() ;j++)
			cell.getItems().newItem(mForms.get(j));
		cell.setValue(back);
	}
	
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private boolean isMedicationInGrid(MedicationLiteVo medication)
{
	if (medication == null)
		return false;
	DynamicGridRowCollection rows = form.lyrMain().tabDetails().dyngrdMedication().getRows();
	for (int i = 0; i < rows.size(); i++)
	{
		if (medication.equals(rows.get(i).getCellArray()[0].getValue()))
			return true;
	}
	return false;
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void enableOnlyEditedConsultant()
{

	DynamicGridRow consultantParent = form.getLocalContext().getCurrentEditedConsultant();
	DynamicGridRowCollection rows = form.dyngrdMain().getRows();
	for (int i = 0; i < rows.size(); i++)
	{
		if (!rows.get(i).equals(consultantParent))
		{
			setNotSelectable(rows.get(i));
		}

	}

}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private SuitableForSurgeryCommentVoCollection populateCommentsGridDataFromScreen()
{
	
	DynamicGridRowCollection rows = form.lyrSuitable().tabPageComments().dyngrdComments().getRows();
	if (rows == null)
		return null;
	SuitableForSurgeryCommentVoCollection comments  = new SuitableForSurgeryCommentVoCollection();
	for (int i=0 ; i<rows.size() ; i++)
	{
		Object value = rows.get(i).getValue();
		if (value instanceof SuitableForSurgeryCommentVo)
			comments.add((SuitableForSurgeryCommentVo) value);
	}
	return comments;
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void markChilds(DynamicGridRowCollection rows, boolean value)
{
	if (rows == null)
		return;

	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridCell selectCell = rows.get(i).getCells().get(getGridColumn(SELECT_IDENTIFIER));
		selectCell.setValue(value);
	}
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void clearBackgroundSelection(DynamicGridRowCollection coll)
{
	if (coll == null)
		return;

	for (int i = 0; coll != null && i < coll.size(); i++)
	{
		coll.get(i).setBackColor(Color.Default);
		if (coll.get(i).getRows() != null && coll.get(i).getRows().size() > 0)
			clearBackgroundSelection(coll.get(i).getRows());
	}
}
 
Example 25
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 5 votes
private ReferralApptStatusCollection getChildNodes(DynamicGridRow selectedRow)
{
	ReferralApptStatusCollection refColl = new ReferralApptStatusCollection();
	DynamicGridColumn col = form.dyngrdStatus().getColumns().get(0);
	DynamicGridCell[] cells = col.getCellArray();
	DynamicGridRowCollection rows = selectedRow.getRows();
	
				for (int i = 0; i <rows.size(); i++)
				{
					refColl.add((ReferralApptStatus) rows.get(i).getCells().get(col).getValue());
				}
	return refColl;
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void displaySetPrimaryLocationMenuOption(DynamicGridRowCollection rows)
{
	form.dyngrdOrganisationLocation().getRows().expandAll();	
	for(int i = 0 ; i < rows.size() ; i++)
	{
		DynamicGridRow row = rows.get(i);
		
	//	if (row.isChecked() == true)
	//		form.getContextMenus().getMosLocationSetPrimaryLocationItem().setVisible(true);
		
		if(row.getRows() != null && row.getRows().size() > 0)
			displaySetPrimaryLocationMenuOption(row.getRows());
	}
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void addConsltantAssociationsToTemplate(MedicLiteVoCollection consultants, DynamicGridRowCollection rows)
{
	// NOTE: DO NOT make consultants = new MedicLiteVoCollection() in this function
	// consultants MUST ALWAYS reference the consultants in the TemplateAssociationVo
	
	if (rows == null)
		return;
	
	if (consultants == null)
		throw new CodingRuntimeException("Logical Error - Inserting values into null CONSULTANTS collection");
	

	// Add the records from the grid
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof MedicLiteVo))
			throw new CodingRuntimeException("Major Logical Error - Non Consultant association added to CONSULTANT category association");
		
		updateConsultantAssociationRowValue(row);
		
		MedicLiteVo consultantAssociation = (MedicLiteVo) row.getValue();
		
		if (consultantAssociation != null)
			consultants.add(consultantAssociation);
	}
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void rebindFormRows()
{
	DynamicGridRowCollection rows = form.lyrDetails().tabFRU().dyngrdFRU().getRows();
	DoseFormIndicatorCollection mForms = ims.clinical.vo.lookups.LookupHelper.getDoseFormIndicator(this.domain.getLookupService());
	for (int i = 0 ; i < rows.size() ; i++)
	{
		if (rows.get(i).getValue() instanceof MedicationFormVo)
		{
			MedicationFormVo x = (MedicationFormVo) rows.get(i).getValue();
			if (!x.getFormIsNotNull())
				continue;
			mForms.remove(x.getForm());
		}	
	}
	for (int i = 0 ; i < rows.size() ; i++)
	{
		DynamicGridCell cell = rows.get(i).getCells().get(form.lyrDetails().tabFRU().dyngrdFRU().getColumns().getByIdentifier(COL_MAIN));
		Object back = cell.getValue();
		cell.getItems().clear();
		if (back!=null)
			cell.getItems().newItem(back);
		for (int j = 0 ; j < mForms.size() ;j++)
			cell.getItems().newItem(mForms.get(j));
		cell.setValue(back);
	}
	
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void markChilds(DynamicGridRowCollection rows, boolean value)
{
	if (rows == null)
		return;

	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridCell selectCell = rows.get(i).getCells().get(getGridColumn(SELECT_IDENTIFIER));
		selectCell.setValue(value);
	}
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private boolean isMedicationInGrid(MedicationLiteVo medication)
{
	if (medication == null)
		return false;
	DynamicGridRowCollection rows = form.lyrMain().tabDetails().dyngrdMedication().getRows();
	for (int i = 0; i < rows.size(); i++)
	{
		if (medication.equals(rows.get(i).getCellArray()[0].getValue()))
			return true;
	}
	return false;
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private DocumentCategoryConfigShortVoCollection populateDataFromScreenDC()
{
	DynamicGridRowCollection rows = form.lyrMain().tabByCategory().dyngrdMapps().getRows();
	DynamicGridColumn colSpec = getColumn(form.lyrMain().tabByCategory().dyngrdMapps(), COLUMN_NAME);
	if (rows.size() == 0)
		return null;
	DocumentCategoryConfigShortVoCollection result = new DocumentCategoryConfigShortVoCollection();

	for (int i = 0; i < rows.size(); i++)
	{
		DocumentCategoryConfigShortVo docCat = (DocumentCategoryConfigShortVo) rows.get(i).getValue();
		docCat.setSpecialty(null);

		DynamicGridRowCollection specR = rows.get(i).getRows();
		if (specR != null && specR.size() > 0)
		{
			docCat.setSpecialty(new SpecialtyCollection());
			for (int j = 0; j < specR.size(); j++)
			{
				Object spec = specR.get(j).getCells().get(colSpec).getValue();
				if (spec instanceof Specialty)
				{
					docCat.getSpecialty().add((Specialty) spec);
				}
			}
		}
		result.add(docCat);
	}

	return result;
}
 
Example 32
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License Vote up 5 votes
private DynamicGridRow findFirstRowWithSameIdentifier(DynamicGridRowCollection rows, Object identifier)
{
	if(rows == null || identifier == null)
		return null;
			
	for(int x = 0; x < rows.size(); x++)
	{
		if(identifier.equals(rows.get(x).getIdentifier()))
		{
			return rows.get(x);
		}
	}
	
	return null;
}
 
Example 33
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void rebindAllMedications()
{
	DynamicGridRowCollection rows = form.lyrMain().tabDetails().dyngrdMedication().getRows();
	MedicationLiteVoCollection allMedications = (MedicationLiteVoCollection) form.getLocalContext().getAllMedications().clone();
	if (allMedications == null)
		return;
	MedicationLiteVoCollection availableMedications = new MedicationLiteVoCollection();
	for (int i = 0; i < allMedications.size(); i++)
	{
		if (!isMedicationInGrid(allMedications.get(i)))
		{
			availableMedications.add(allMedications.get(i));
		}
	}
	availableMedications.sort();
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridCell cell = rows.get(i).getCellArray()[0];
		Object value = cell.getValue();
		cell.getItems().clear();

		DynamicGridCellItem item = null;
		if (value != null)
		{
			item = cell.getItems().newItem(value);
			item.setValue(value);
		}
		for (int j = 0; j < availableMedications.size(); j++)
		{
			item = cell.getItems().newItem(availableMedications.get(j).getMedicationName());
			item.setValue(availableMedications.get(j));
		}
		cell.setValue(value);
	}
	for (int i = 0; i < availableMedications.size(); i++)
	{

	}
}
 
Example 34
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private AdmissionDetailForCoderWorklistVoCollection getValuesFromGrid()
{
	AdmissionDetailForCoderWorklistVoCollection coll = new AdmissionDetailForCoderWorklistVoCollection();

	DynamicGridRowCollection rows = form.dynGrdCodingRecords().getRows();
	for (int i=0;i<rows.size();i++)
	{
		if (rows.get(i) == null || rows.get(i).getValue() == null)
			continue;
		coll.add((AdmissionDetailForCoderWorklistVo) rows.get(i).getValue());
	}
	
	return coll;	
}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void addConsltantAssociationsToTemplate(MedicLiteVoCollection consultants, DynamicGridRowCollection rows)
{
	// NOTE: DO NOT make consultants = new MedicLiteVoCollection() in this function
	// consultants MUST ALWAYS reference the consultants in the TemplateAssociationVo
	
	if (rows == null)
		return;
	
	if (consultants == null)
		throw new CodingRuntimeException("Logical Error - Inserting values into null CONSULTANTS collection");
	

	// Add the records from the grid
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof MedicLiteVo))
			throw new CodingRuntimeException("Major Logical Error - Non Consultant association added to CONSULTANT category association");
		
		updateConsultantAssociationRowValue(row);
		
		MedicLiteVo consultantAssociation = (MedicLiteVo) row.getValue();
		
		if (consultantAssociation != null)
			consultants.add(consultantAssociation);
	}
}
 
Example 36
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void addSpecialtyAssociationsToTemplate(SpecialtyCollection specialties, DynamicGridRowCollection rows)
{
	// NOTE: DO NOT make specialties = new SpecialtyCollection() in this function
	// specialties MUST ALWAYS reference the specialties in the TemplateAssociationVo
	
	if (rows == null)
		return;
	
	if (specialties == null)
		throw new CodingRuntimeException("Logical Error - Inserting values into null SPECIALTIES collection");
	
	
	// Add the records from the grid
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof Specialty))
			throw new CodingRuntimeException("Major Logical Error - Non Specialty association added to SPECIALTIES category");
		
		updateSpecialtyAssociationRowValue(row);
		
		Specialty specialtyAssociation = (Specialty) row.getValue();
		
		if (specialtyAssociation != null)
			specialties.add(specialtyAssociation);
	}
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 5 votes
private void addSelectedAvailable()
{
	tabByCategoryContainer tab = form.lyrMain().tabByCategory();
	DynamicGridColumn colSel = getColumn(tab.dyngrdAvailableRep(), COLUMN_SELECT);

	for (int i = 0; i < tab.dyngrdAvailableRep().getRows().size(); i++)
	{
		DynamicGridRowCollection templates = tab.dyngrdAvailableRep().getRows().get(i).getRows();
		if (templates != null)
		{
			for (int j = 0; j < templates.size(); j++)
			{

				if (Boolean.TRUE.equals(templates.get(j).getCells().get(colSel).getValue()))
				{
					DocumentCategoryConfigShortVo docCat = new DocumentCategoryConfigShortVo();
					docCat.setTemplate((TemplateForPatientDocumentVo) templates.get(j).getValue());
					docCat.setCategory(tab.grdDocCat().getValue());
					addRowToMappGrid(docCat);
				}
			}

		}
	}
	searchDC(false);
	updateControlsState();
}
 
Example 38
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void addSpecialtyToUserAccess(SpecialtyAccessVoCollection specialties, DynamicGridRowCollection rows)
{
	// NOTE: DO NOT make specialties = new SpecialtyAccessVoCollection() in this function
	// specialties MUST ALWAYS reference the clinics in the UserAccessVo

	if (rows == null)
		return;
	
	if (specialties == null)
			throw new CodingRuntimeException("Logical Error - Inserting values into null SPECIALTY collection");
	
	
	// Add the records from the grid
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof SpecialtyAccessVo))
			throw new CodingRuntimeException("Major Logical Error");
		
		updateSpecialtyAccessRowValue(row);
		
		SpecialtyAccessVo specialtyAccess = (SpecialtyAccessVo) row.getValue();
		
		if (specialtyAccess.getSpecialty() != null || specialtyAccess.getAccessRight() != null)
		{
			specialties.add((SpecialtyAccessVo) row.getValue());
		}
	}
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private void removeBlankRows(DynamicGridRowCollection rows)
{
	int initialSize = rows.size();
	DynamicGridColumn  leftColumn = form.dyngrdMotor().getColumns().getByIdentifier(LEFT_COLUMN);
	DynamicGridColumn rightColumn = form.dyngrdMotor().getColumns().getByIdentifier(RIGHT_COLUMN);
	
	for (int i = 0; i < initialSize; i++)
	{
		if (i < rows.size())
		{
			DynamicGridRow row = rows.get(i);

			if (row.getValue() instanceof MotorAreaVo && row.getRows().size() == 0 
					&& (row.getCells().get(leftColumn).getValue() == null) && (row.getCells().get(rightColumn).getValue() == null))
			{
				form.dyngrdMotor().getRows().remove(row);
				removeBlankRows(rows);
			}
			
			if ((row.getValue() instanceof MotorAreaVo) && (row.getRows().size()> 0))
			{
				for(int z =0; z<row.getRows().size(); z++)
				{
					DynamicGridRow rowGroup = row.getRows().get(z);
					if ((rowGroup.getValue() instanceof MuscleGroupsVo))
					{
						if (rowGroup.getRows().size() == 0 && (rowGroup.getCells().get(leftColumn).getValue() == null) && (rowGroup.getCells().get(rightColumn).getValue() == null))
						{
							//rows.get(z).getRows().remove(rowGroup);
							row.getRows().remove(rowGroup);
							removeBlankRows(rows);
						}

						if(rowGroup.getRows().size()>0)
						{
							for(int x=0; x < rowGroup.getRows().size(); x++)
							{
								DynamicGridRow mRow = rowGroup.getRows().get(x);
								if ((mRow.getCells().get(leftColumn).getValue() == null) && (mRow.getCells().get(rightColumn).getValue() == null))
								{
									rowGroup.getRows().remove(mRow);
									removeBlankRows(rows);
								}
							}
						}								
					}
				}
			}
			
			//if (row.getRows().size() > 0)
			//	removeBlankRows(row.getRows());
		}

	}
	return;
}
 
Example 40
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 4 votes
private CommChannelConfigVo populateDataFromScreen(CommChannelConfigVo cc)
{
	TelecomTypeVo tt = null;
	TelecomUsageTypeVo mm = null;
	
	if (cc == null)
		cc = new CommChannelConfigVo();
	
		cc.setTelecomTypes(new TelecomTypeVoCollection());
	
		for(int i = 0; i < form.grdChannelType().getRows().size(); i++)
		{
			tt = new TelecomTypeVo();
			grdChannelTypeRow row = form.grdChannelType().getRows().get(i);
			tt.setChannelType(row.getValue().getChannelType());
			tt.setVisibleOnDemographics(row.getcolVisibleDemographics());
			tt.setVisibleOnStaffGp(row.getcolVisibleStaffGP());
			cc.getTelecomTypes().add(tt);
		}
		
		
		cc.setMappings(new TelecomUsageTypeVoCollection());
		
		for(int i = 0; i < form.dyngrdComTypeUsage().getRows().size(); i++)
		{
			mm = new TelecomUsageTypeVo();
			DynamicGridRow dynamicGridRow = form.dyngrdComTypeUsage().getRows().get(i);
			DynamicGridRowCollection rows = dynamicGridRow.getRows();
			 
			mm.setUsage((PDSChannelUsage)dynamicGridRow.getValue());
			
			 if(rows != null && rows.size() > 0)
			 {
				 int channels = rows.size();
			
				 mm.setChannelTypes(new ChannelTypeCollection());
				 for (int j = 0 ; j < channels; j++)
				 {
					 DynamicGridColumn mainColUsage = form.dyngrdComTypeUsage().getColumns().getByIdentifier(COL_USAGE);
					 DynamicGridCell dynamicGridCellUsage = rows.get(j).getCells().get(mainColUsage);
					 
					 mm.getChannelTypes().add((ChannelType)dynamicGridCellUsage.getValue());
					 
					 DynamicGridColumn mainColDef = form.dyngrdComTypeUsage().getColumns().getByIdentifier(COL_DEFAULT);
					 DynamicGridCell dynamicGridCellDef = rows.get(j).getCells().get(mainColDef);
					 
					 if(Boolean.TRUE.equals(dynamicGridCellDef.getValue()))
						 mm.setDefaultChannelType((ChannelType) dynamicGridCellUsage.getValue());
				 }
			 }
			 cc.getMappings().add(mm);
		}
	
	return cc;
}