Java Code Examples for ims.ocrr.vo.OrderInvestigationVoCollection

The following are top voted examples for showing how to use ims.ocrr.vo.OrderInvestigationVoCollection. 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 open()
{
	OrderSpecimenVoCollection potentialSpecimens = form.getGlobalContext().OCRR.getMyOrderPotentialSpecimens();
	// Sort potential specimens
	potentialSpecimens.sort();
	
	// Build alternative containers hash map
	HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers = buildHashMapOfAlternativeContainers(potentialSpecimens);
	
	// Check for alternative options
	if (!choicesAvailable(alternativeContainers))
	{
		engine.close(DialogResult.CANCEL);
		return;
	}
	
	populateSpecimensWithAlternateContainers(potentialSpecimens, alternativeContainers);
}
 
Example 2
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 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private OrderPriority getPriorityIfExists(InvestigationIndexShortVo investigationIndex, OrderInvestigationVoCollection orderInvestigations)
{
	if (orderInvestigations == null)
		return null;
	
	if (investigationIndex == null || investigationIndex.getID_InvestigationIndex() == null)
		return null;
	
	for (OrderInvestigationVo investigation : orderInvestigations)
	{
		if (investigation.getInvestigation() != null && investigation.getInvestigation().getInvestigationIndex() != null)
		{
			if (investigationIndex.getID_InvestigationIndex() == investigation.getInvestigation().getInvestigationIndex().getID_InvestigationIndex())
				return investigation.getOrderPriority();
		}
	}
	
	return null;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private OrderInvestigationVo getOrderInvestigationFromContextByInvestID(Integer investigationId)
{
	OrderInvestigationVo voOrderInvest = null;
	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0)
	{
		for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		{
			if (voCollOrderInvestigation.get(i).getInvestigationIsNotNull() && voCollOrderInvestigation.get(i).getInvestigation().getID_Investigation().equals(investigationId))
			{
				voOrderInvest = voCollOrderInvestigation.get(i);
				return voOrderInvest;
			}
		}
	}
	return null;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean doesOrderContainInvType(Category category)
{
	if (category == null)
		return false;

	OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	if (voCollOrderInvest == null)
		return false;

	boolean isClinicalImagingFound = false;
	for (int i = 0; i < voCollOrderInvest.size(); i++)
	{
		if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null
				|| (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus())))
		{
			if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category))
			{
				isClinicalImagingFound = true;
				break;
			}
		}
	}

	return isClinicalImagingFound;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isPrioritySet(OrderInvestigationVoCollection voCollOrderInvest)
{
	boolean bPrioritiesSet = false;
	
	for (int i = 0; i < voCollOrderInvest.size();)
	{
		if (voCollOrderInvest.get(i).getOrderPriorityIsNotNull()) //WDEV-16875
		{
			bPrioritiesSet = voCollOrderInvest.get(i).getOrderPriorityIsNotNull();
			break;
		}
		else
			i++;
	}
	
	return bPrioritiesSet;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open()
{
	OrderSpecimenVoCollection potentialSpecimens = form.getGlobalContext().OCRR.getMyOrderPotentialSpecimens();
	// Sort potential specimens
	potentialSpecimens.sort();
	
	// Build alternative containers hash map
	HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers = buildHashMapOfAlternativeContainers(potentialSpecimens);
	
	// Check for alternative options
	if (!choicesAvailable(alternativeContainers))
	{
		engine.close(DialogResult.CANCEL);
		return;
	}
	
	populateSpecimensWithAlternateContainers(potentialSpecimens, alternativeContainers);
}
 
Example 8
Project: openMAXIMS   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 9
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private OrderPriority getPriorityIfExists(InvestigationIndexShortVo investigationIndex, OrderInvestigationVoCollection orderInvestigations)
{
	if (orderInvestigations == null)
		return null;
	
	if (investigationIndex == null || investigationIndex.getID_InvestigationIndex() == null)
		return null;
	
	for (OrderInvestigationVo investigation : orderInvestigations)
	{
		if (investigation.getInvestigation() != null && investigation.getInvestigation().getInvestigationIndex() != null)
		{
			if (investigationIndex.getID_InvestigationIndex() == investigation.getInvestigation().getInvestigationIndex().getID_InvestigationIndex())
				return investigation.getOrderPriority();
		}
	}
	
	return null;
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private OrderInvestigationVo getOrderInvestigationFromContextByInvestID(Integer investigationId)
{
	OrderInvestigationVo voOrderInvest = null;
	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0)
	{
		for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		{
			if (voCollOrderInvestigation.get(i).getInvestigationIsNotNull() && voCollOrderInvestigation.get(i).getInvestigation().getID_Investigation().equals(investigationId))
			{
				voOrderInvest = voCollOrderInvestigation.get(i);
				return voOrderInvest;
			}
		}
	}
	return null;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean doesOrderContainInvType(Category category)
{
	if (category == null)
		return false;

	OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	if (voCollOrderInvest == null)
		return false;

	boolean isClinicalImagingFound = false;
	for (int i = 0; i < voCollOrderInvest.size(); i++)
	{
		if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null
				|| (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus())))
		{
			if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category))
			{
				isClinicalImagingFound = true;
				break;
			}
		}
	}

	return isClinicalImagingFound;
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isPrioritySet(OrderInvestigationVoCollection voCollOrderInvest)
{
	boolean bPrioritiesSet = false;
	
	for (int i = 0; i < voCollOrderInvest.size();)
	{
		if (voCollOrderInvest.get(i).getOrderPriorityIsNotNull()) //WDEV-16875
		{
			bPrioritiesSet = voCollOrderInvest.get(i).getOrderPriorityIsNotNull();
			break;
		}
		else
			i++;
	}
	
	return bPrioritiesSet;
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open()
{
	OrderSpecimenVoCollection potentialSpecimens = form.getGlobalContext().OCRR.getMyOrderPotentialSpecimens();
	// Sort potential specimens
	potentialSpecimens.sort();
	
	// Build alternative containers hash map
	HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers = buildHashMapOfAlternativeContainers(potentialSpecimens);
	
	// Check for alternative options
	if (!choicesAvailable(alternativeContainers))
	{
		engine.close(DialogResult.CANCEL);
		return;
	}
	
	populateSpecimensWithAlternateContainers(potentialSpecimens, alternativeContainers);
}
 
Example 14
Project: openMAXIMS   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 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private OrderPriority getPriorityIfExists(InvestigationIndexShortVo investigationIndex, OrderInvestigationVoCollection orderInvestigations)
{
	if (orderInvestigations == null)
		return null;
	
	if (investigationIndex == null || investigationIndex.getID_InvestigationIndex() == null)
		return null;
	
	for (OrderInvestigationVo investigation : orderInvestigations)
	{
		if (investigation.getInvestigation() != null && investigation.getInvestigation().getInvestigationIndex() != null)
		{
			if (investigationIndex.getID_InvestigationIndex() == investigation.getInvestigation().getInvestigationIndex().getID_InvestigationIndex())
				return investigation.getOrderPriority();
		}
	}
	
	return null;
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private OrderInvestigationVo getOrderInvestigationFromContextByInvestID(Integer investigationId)
{
	OrderInvestigationVo voOrderInvest = null;
	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0)
	{
		for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		{
			if (voCollOrderInvestigation.get(i).getInvestigationIsNotNull() && voCollOrderInvestigation.get(i).getInvestigation().getID_Investigation().equals(investigationId))
			{
				voOrderInvest = voCollOrderInvestigation.get(i);
				return voOrderInvest;
			}
		}
	}
	return null;
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean doesOrderContainInvType(Category category)
{
	if (category == null)
		return false;

	OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	if (voCollOrderInvest == null)
		return false;

	boolean isClinicalImagingFound = false;
	for (int i = 0; i < voCollOrderInvest.size(); i++)
	{
		if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null
				|| (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus())))
		{
			if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category))
			{
				isClinicalImagingFound = true;
				break;
			}
		}
	}

	return isClinicalImagingFound;
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isPrioritySet(OrderInvestigationVoCollection voCollOrderInvest)
{
	boolean bPrioritiesSet = false;
	
	for (int i = 0; i < voCollOrderInvest.size();)
	{
		if (voCollOrderInvest.get(i).getOrderPriorityIsNotNull()) //WDEV-16875
		{
			bPrioritiesSet = voCollOrderInvest.get(i).getOrderPriorityIsNotNull();
			break;
		}
		else
			i++;
	}
	
	return bPrioritiesSet;
}
 
Example 19
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open()
{
	OrderSpecimenVoCollection potentialSpecimens = form.getGlobalContext().OCRR.getMyOrderPotentialSpecimens();
	// Sort potential specimens
	potentialSpecimens.sort();
	
	// Build alternative containers hash map
	HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers = buildHashMapOfAlternativeContainers(potentialSpecimens);
	
	// Check for alternative options
	if (!choicesAvailable(alternativeContainers))
	{
		engine.close(DialogResult.CANCEL);
		return;
	}
	
	populateSpecimensWithAlternateContainers(potentialSpecimens, alternativeContainers);
}
 
Example 20
Project: openmaxims-linux   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 21
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private OrderPriority getPriorityIfExists(InvestigationIndexShortVo investigationIndex, OrderInvestigationVoCollection orderInvestigations)
{
	if (orderInvestigations == null)
		return null;
	
	if (investigationIndex == null || investigationIndex.getID_InvestigationIndex() == null)
		return null;
	
	for (OrderInvestigationVo investigation : orderInvestigations)
	{
		if (investigation.getInvestigation() != null && investigation.getInvestigation().getInvestigationIndex() != null)
		{
			if (investigationIndex.getID_InvestigationIndex() == investigation.getInvestigation().getInvestigationIndex().getID_InvestigationIndex())
				return investigation.getOrderPriority();
		}
	}
	
	return null;
}
 
Example 22
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private OrderInvestigationVo getOrderInvestigationFromContextByInvestID(Integer investigationId)
{
	OrderInvestigationVo voOrderInvest = null;
	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0)
	{
		for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		{
			if (voCollOrderInvestigation.get(i).getInvestigationIsNotNull() && voCollOrderInvestigation.get(i).getInvestigation().getID_Investigation().equals(investigationId))
			{
				voOrderInvest = voCollOrderInvestigation.get(i);
				return voOrderInvest;
			}
		}
	}
	return null;
}
 
Example 23
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean doesOrderContainInvType(Category category)
{
	if (category == null)
		return false;

	OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	if (voCollOrderInvest == null)
		return false;

	boolean isClinicalImagingFound = false;
	for (int i = 0; i < voCollOrderInvest.size(); i++)
	{
		if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null
				|| (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus())))
		{
			if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category))
			{
				isClinicalImagingFound = true;
				break;
			}
		}
	}

	return isClinicalImagingFound;
}
 
Example 24
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isPrioritySet(OrderInvestigationVoCollection voCollOrderInvest)
{
	boolean bPrioritiesSet = false;
	
	for (int i = 0; i < voCollOrderInvest.size();)
	{
		if (voCollOrderInvest.get(i).getOrderPriorityIsNotNull()) //WDEV-16875
		{
			bPrioritiesSet = voCollOrderInvest.get(i).getOrderPriorityIsNotNull();
			break;
		}
		else
			i++;
	}
	
	return bPrioritiesSet;
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSpecimensWithAlternateContainers(OrderSpecimenVoCollection potentialSpecimens, HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers)
{
	// Clear grid
	form.grdItems().getRows().clear();
	
	if (potentialSpecimens == null)
		return;

	for (OrderSpecimenVo specimen : potentialSpecimens)
	{
		HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers = alternativeContainers.get(specimen);
		
		if (specimenHasOptions(specimenAlternateContainers))
		{
			// Create Specimen parent row
			grdItemsRow specimenRow = form.grdItems().getRows().newRow();

			// Add investigation rows
			float totalRequiredVolume = addInvestigationsWithAlternates(specimen.getInvestigations(), specimenRow, specimenAlternateContainers);

			// Set specimen text
			specimenRow.setColText(getSpecimenDisplayText(specimen, totalRequiredVolume));
			// Expand Specimen parent row
			specimenRow.setExpanded(true);
		}
	}
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean choicesAvailable(HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers)
{
	Collection<HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> specimenMaps = alternativeContainers.values();
	
	for (HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenMap : specimenMaps)
	{
		if (specimenHasOptions(specimenMap))
			return true;
	}

	return false;
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean specimenHasOptions(HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers)
{
	Set<PathSpecimenContainerDetailVo> keys = specimenAlternateContainers.keySet();
	
	for (PathSpecimenContainerDetailVo specimenContainer : keys)
	{
		OrderInvestigationVoCollection values = specimenAlternateContainers.get(specimenContainer);
		
		if (values != null && values.size() > 1)
		{
			for (OrderInvestigationVo investigation : values)
			{
				PathInvDetailsVo pathologyDetails = null;
				
				if (investigation.getInvestigation().getParentInvestigationPathDetails() != null)
				{
					pathologyDetails = investigation.getInvestigation().getParentInvestigationPathDetails();
				}
				else
				{
					pathologyDetails = investigation.getInvestigation().getPathInvDetails();
				}
				
				SpecimenVo specimenVo = pathologyDetails.getSpecimens().get(0);
				
				if (specimenVo.getAlternativePaediatricContainers() != null)
				{
					for (SpecimenContainerVo container : specimenVo.getAlternativePaediatricContainers())
					{
						if (container.getSpecContainer().equals(specimenContainer))
							return true;
					}
				}
			}
		}
	}

	return false;
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateInvestigationsGridAndRecalculateContainers()
{
	// this takes the modified investigations from container choice dialog and repopulates the grid and does container calculation again
	if (form.getGlobalContext().OCRR.getReWrittenOrderInvestigationsIsNotNull())
	{
		OrderInvestigationVoCollection voCollRewrittenOrderInv = form.getGlobalContext().OCRR.getReWrittenOrderInvestigations();

		for (int i = 0; i < form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().size(); i++)
		{
			grdTestRow row = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().get(i);
			if (voCollRewrittenOrderInv.contains(row.getValue()))
				row.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(row.getValue())));

			for (int p = 0; p < row.getRows().size(); p++)
			{
				grdTestRow cRow = row.getRows().get(p);
				if (voCollRewrittenOrderInv.contains(cRow.getValue()))
					cRow.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(cRow.getValue())));
			}
		}
	}

	try
	{
		form.getGlobalContext().OCRR.setMyOrderPotentialSpecimens(null);
		btnGenerateSpecimensClick(-1);
	}
	catch (PresentationLogicException e)
	{
		e.printStackTrace();
	}
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void cmPriorityValueChanged()
{
	if (form.lyrDetails().tabGenDetails().cmbPriority().getValue() != null && form.lyrDetails().tabGenDetails().cmbPriority().getValue().equals(OrderPriority.VARIOUS))
		return;

	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation == null)
		throw new CodingRuntimeException("Coding Error - OrderInvestigation Collection is null (onCmbPriorityValueChanged)");

	for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		voCollOrderInvestigation.get(i).setOrderPriority(form.lyrDetails().tabGenDetails().cmbPriority().getValue());

	form.getGlobalContext().OCRR.setOrderInvestigationCollection(voCollOrderInvestigation);
	setOrderPriorityInGrid();
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void prePopulateRadPrintItems()
{
	OrderInvestigationVoCollection voCollOrderInv = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	SelectItemVoCollection voCollItems = new SelectItemVoCollection();

	if (voCollOrderInv != null)
	{
		for (int i = 0; i < voCollOrderInv.size(); i++)
		{
			if (voCollOrderInv.get(i).getInvestigationIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(Category.CLINICALIMAGING))
			{
				SelectItemVo voSelectItem = new SelectItemVo();
				voSelectItem.setItem(voCollOrderInv.get(i).getInvestigation().getInvestigationIndex());
				voSelectItem.setSelected(Boolean.FALSE);
				voCollItems.add(voSelectItem);
			}
		}
	}

	form.getGlobalContext().Core.setItems(voCollItems.size() > 0 ? voCollItems : null);

	InvestigationIndexRefVoCollection voCollInvIndex = new InvestigationIndexRefVoCollection();
	if (voCollItems != null)
	{
		for (int i = 0; i < voCollItems.size(); i++)
		{
			if (voCollItems.get(i).getItemIsNotNull())
			{
				if (voCollItems.get(i).getItem() instanceof InvestigationIndexLiteVo && voCollItems.get(i).getSelectedIsNotNull() && voCollItems.get(i).getSelected().equals(Boolean.FALSE))
				{
					voCollInvIndex.add((InvestigationIndexRefVo) voCollItems.get(i).getItem());
				}
			}
		}
	}
	form.getGlobalContext().OCRR.PrintOrder.setNotLocalInvestigations(voCollInvIndex.size() > 0 ? voCollInvIndex : null);
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isTimeSeriesInvestigationIdentifier(Object identifier)
{
	if (identifier instanceof OrderInvestigationVoCollection)
	{
		OrderInvestigationVoCollection investigationCollection = (OrderInvestigationVoCollection) identifier;
		
		if (investigationCollection.size() == 1)
		{
			if (InvEventType.TIME_SERIES.equals(investigationCollection.get(0).getInvestigation().getEventType()))
				return true;
		}
	}

	return false;
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private InvestigationUnderSpecimenVo getInvestUnderSpecimenVoFromContextByOrderInvestigation(OrderInvestigationRefVo voOrderInvestigation)
{
	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0)
	{
		for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		{
			if (voCollOrderInvestigation.get(i).equals(voOrderInvestigation))
				return voCollOrderInvestigation.get(i).getInvestigation();
		}
	}
	return null;
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isAnyAddOnsSelected()
{
	OrderInvestigationVoCollection voCollOrderInv = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getValues();
	for (int i = 0; i < voCollOrderInv.size(); i++)
	{
		if (voCollOrderInv.get(i) != null)
		{
			if (voCollOrderInv.get(i).getInvestigation().getIsAddonIsNotNull() && voCollOrderInv.get(i).getInvestigation().getIsAddon().booleanValue())
				return true;
		}
	}

	return false;
}
 
Example 34
Project: AvoinApotti   File: PathologyDialogImpl.java   Source Code and License 5 votes vote down vote up
public String getCentricityPacsAccessionNumber(OrderInvestigationRefVo voOrderInvRefVo) 
{
	if(voOrderInvRefVo == null || voOrderInvRefVo.getID_OrderInvestigation() == null)
		throw new DomainRuntimeException("Invalid OrderInvestigation id");
	
	if(voOrderInvRefVo != null)
	{
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" select o1_1 from OrderInvestigation as o1_1 where  "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + " o1_1.id  = :OrderInvId");
			markers.add("OrderInvId");
		values.add(voOrderInvRefVo.getID_OrderInvestigation());
		andStr = " and ";	

		List<?> list = factory.find(hql.toString(), markers,values);
		if(list != null && list.size() > 0)
		{ 
			OrderInvestigationVoCollection voColl = OrderInvestigationVoAssembler.createOrderInvestigationVoCollectionFromOrderInvestigation(list);
			if(voColl != null && voColl.size() > 0)
				return voColl.get(0).getAccessionNumber();
		}
	}
	return null;
}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSpecimensWithAlternateContainers(OrderSpecimenVoCollection potentialSpecimens, HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers)
{
	// Clear grid
	form.grdItems().getRows().clear();
	
	if (potentialSpecimens == null)
		return;

	for (OrderSpecimenVo specimen : potentialSpecimens)
	{
		HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers = alternativeContainers.get(specimen);
		
		if (specimenHasOptions(specimenAlternateContainers))
		{
			// Create Specimen parent row
			grdItemsRow specimenRow = form.grdItems().getRows().newRow();

			// Add investigation rows
			float totalRequiredVolume = addInvestigationsWithAlternates(specimen.getInvestigations(), specimenRow, specimenAlternateContainers);

			// Set specimen text
			specimenRow.setColText(getSpecimenDisplayText(specimen, totalRequiredVolume));
			// Expand Specimen parent row
			specimenRow.setExpanded(true);
		}
	}
}
 
Example 36
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean choicesAvailable(HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers)
{
	Collection<HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> specimenMaps = alternativeContainers.values();
	
	for (HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenMap : specimenMaps)
	{
		if (specimenHasOptions(specimenMap))
			return true;
	}

	return false;
}
 
Example 37
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean specimenHasOptions(HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers)
{
	Set<PathSpecimenContainerDetailVo> keys = specimenAlternateContainers.keySet();
	
	for (PathSpecimenContainerDetailVo specimenContainer : keys)
	{
		OrderInvestigationVoCollection values = specimenAlternateContainers.get(specimenContainer);
		
		if (values != null && values.size() > 1)
		{
			for (OrderInvestigationVo investigation : values)
			{
				PathInvDetailsVo pathologyDetails = null;
				
				if (investigation.getInvestigation().getParentInvestigationPathDetails() != null)
				{
					pathologyDetails = investigation.getInvestigation().getParentInvestigationPathDetails();
				}
				else
				{
					pathologyDetails = investigation.getInvestigation().getPathInvDetails();
				}
				
				SpecimenVo specimenVo = pathologyDetails.getSpecimens().get(0);
				
				if (specimenVo.getAlternativePaediatricContainers() != null)
				{
					for (SpecimenContainerVo container : specimenVo.getAlternativePaediatricContainers())
					{
						if (container.getSpecContainer().equals(specimenContainer))
							return true;
					}
				}
			}
		}
	}

	return false;
}
 
Example 38
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateInvestigationsGridAndRecalculateContainers()
{
	// this takes the modified investigations from container choice dialog and repopulates the grid and does container calculation again
	if (form.getGlobalContext().OCRR.getReWrittenOrderInvestigationsIsNotNull())
	{
		OrderInvestigationVoCollection voCollRewrittenOrderInv = form.getGlobalContext().OCRR.getReWrittenOrderInvestigations();

		for (int i = 0; i < form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().size(); i++)
		{
			grdTestRow row = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().get(i);
			if (voCollRewrittenOrderInv.contains(row.getValue()))
				row.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(row.getValue())));

			for (int p = 0; p < row.getRows().size(); p++)
			{
				grdTestRow cRow = row.getRows().get(p);
				if (voCollRewrittenOrderInv.contains(cRow.getValue()))
					cRow.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(cRow.getValue())));
			}
		}
	}

	try
	{
		form.getGlobalContext().OCRR.setMyOrderPotentialSpecimens(null);
		btnGenerateSpecimensClick(-1);
	}
	catch (PresentationLogicException e)
	{
		e.printStackTrace();
	}
}
 
Example 39
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void cmPriorityValueChanged()
{
	if (form.lyrDetails().tabGenDetails().cmbPriority().getValue() != null && form.lyrDetails().tabGenDetails().cmbPriority().getValue().equals(OrderPriority.VARIOUS))
		return;

	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation == null)
		throw new CodingRuntimeException("Coding Error - OrderInvestigation Collection is null (onCmbPriorityValueChanged)");

	for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		voCollOrderInvestigation.get(i).setOrderPriority(form.lyrDetails().tabGenDetails().cmbPriority().getValue());

	form.getGlobalContext().OCRR.setOrderInvestigationCollection(voCollOrderInvestigation);
	setOrderPriorityInGrid();
}
 
Example 40
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void prePopulateRadPrintItems()
{
	OrderInvestigationVoCollection voCollOrderInv = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	SelectItemVoCollection voCollItems = new SelectItemVoCollection();

	if (voCollOrderInv != null)
	{
		for (int i = 0; i < voCollOrderInv.size(); i++)
		{
			if (voCollOrderInv.get(i).getInvestigationIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(Category.CLINICALIMAGING))
			{
				SelectItemVo voSelectItem = new SelectItemVo();
				voSelectItem.setItem(voCollOrderInv.get(i).getInvestigation().getInvestigationIndex());
				voSelectItem.setSelected(Boolean.FALSE);
				voCollItems.add(voSelectItem);
			}
		}
	}

	form.getGlobalContext().Core.setItems(voCollItems.size() > 0 ? voCollItems : null);

	InvestigationIndexRefVoCollection voCollInvIndex = new InvestigationIndexRefVoCollection();
	if (voCollItems != null)
	{
		for (int i = 0; i < voCollItems.size(); i++)
		{
			if (voCollItems.get(i).getItemIsNotNull())
			{
				if (voCollItems.get(i).getItem() instanceof InvestigationIndexLiteVo && voCollItems.get(i).getSelectedIsNotNull() && voCollItems.get(i).getSelected().equals(Boolean.FALSE))
				{
					voCollInvIndex.add((InvestigationIndexRefVo) voCollItems.get(i).getItem());
				}
			}
		}
	}
	form.getGlobalContext().OCRR.PrintOrder.setNotLocalInvestigations(voCollInvIndex.size() > 0 ? voCollInvIndex : null);
}
 
Example 41
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isTimeSeriesInvestigationIdentifier(Object identifier)
{
	if (identifier instanceof OrderInvestigationVoCollection)
	{
		OrderInvestigationVoCollection investigationCollection = (OrderInvestigationVoCollection) identifier;
		
		if (investigationCollection.size() == 1)
		{
			if (InvEventType.TIME_SERIES.equals(investigationCollection.get(0).getInvestigation().getEventType()))
				return true;
		}
	}

	return false;
}
 
Example 42
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private InvestigationUnderSpecimenVo getInvestUnderSpecimenVoFromContextByOrderInvestigation(OrderInvestigationRefVo voOrderInvestigation)
{
	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0)
	{
		for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		{
			if (voCollOrderInvestigation.get(i).equals(voOrderInvestigation))
				return voCollOrderInvestigation.get(i).getInvestigation();
		}
	}
	return null;
}
 
Example 43
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isAnyAddOnsSelected()
{
	OrderInvestigationVoCollection voCollOrderInv = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getValues();
	for (int i = 0; i < voCollOrderInv.size(); i++)
	{
		if (voCollOrderInv.get(i) != null)
		{
			if (voCollOrderInv.get(i).getInvestigation().getIsAddonIsNotNull() && voCollOrderInv.get(i).getInvestigation().getIsAddon().booleanValue())
				return true;
		}
	}

	return false;
}
 
Example 44
Project: openMAXIMS   File: PathologyDialogImpl.java   Source Code and License 5 votes vote down vote up
public String getCentricityPacsAccessionNumber(OrderInvestigationRefVo voOrderInvRefVo) 
{
	if(voOrderInvRefVo == null || voOrderInvRefVo.getID_OrderInvestigation() == null)
		throw new DomainRuntimeException("Invalid OrderInvestigation id");
	
	if(voOrderInvRefVo != null)
	{
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" select o1_1 from OrderInvestigation as o1_1 where  "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + " o1_1.id  = :OrderInvId");
			markers.add("OrderInvId");
		values.add(voOrderInvRefVo.getID_OrderInvestigation());
		andStr = " and ";	

		List<?> list = factory.find(hql.toString(), markers,values);
		if(list != null && list.size() > 0)
		{ 
			OrderInvestigationVoCollection voColl = OrderInvestigationVoAssembler.createOrderInvestigationVoCollectionFromOrderInvestigation(list);
			if(voColl != null && voColl.size() > 0)
				return voColl.get(0).getAccessionNumber();
		}
	}
	return null;
}
 
Example 45
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSpecimensWithAlternateContainers(OrderSpecimenVoCollection potentialSpecimens, HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers)
{
	// Clear grid
	form.grdItems().getRows().clear();
	
	if (potentialSpecimens == null)
		return;

	for (OrderSpecimenVo specimen : potentialSpecimens)
	{
		HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers = alternativeContainers.get(specimen);
		
		if (specimenHasOptions(specimenAlternateContainers))
		{
			// Create Specimen parent row
			grdItemsRow specimenRow = form.grdItems().getRows().newRow();

			// Add investigation rows
			float totalRequiredVolume = addInvestigationsWithAlternates(specimen.getInvestigations(), specimenRow, specimenAlternateContainers);

			// Set specimen text
			specimenRow.setColText(getSpecimenDisplayText(specimen, totalRequiredVolume));
			// Expand Specimen parent row
			specimenRow.setExpanded(true);
		}
	}
}
 
Example 46
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean choicesAvailable(HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers)
{
	Collection<HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> specimenMaps = alternativeContainers.values();
	
	for (HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenMap : specimenMaps)
	{
		if (specimenHasOptions(specimenMap))
			return true;
	}

	return false;
}
 
Example 47
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean specimenHasOptions(HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers)
{
	Set<PathSpecimenContainerDetailVo> keys = specimenAlternateContainers.keySet();
	
	for (PathSpecimenContainerDetailVo specimenContainer : keys)
	{
		OrderInvestigationVoCollection values = specimenAlternateContainers.get(specimenContainer);
		
		if (values != null && values.size() > 1)
		{
			for (OrderInvestigationVo investigation : values)
			{
				PathInvDetailsVo pathologyDetails = null;
				
				if (investigation.getInvestigation().getParentInvestigationPathDetails() != null)
				{
					pathologyDetails = investigation.getInvestigation().getParentInvestigationPathDetails();
				}
				else
				{
					pathologyDetails = investigation.getInvestigation().getPathInvDetails();
				}
				
				SpecimenVo specimenVo = pathologyDetails.getSpecimens().get(0);
				
				if (specimenVo.getAlternativePaediatricContainers() != null)
				{
					for (SpecimenContainerVo container : specimenVo.getAlternativePaediatricContainers())
					{
						if (container.getSpecContainer().equals(specimenContainer))
							return true;
					}
				}
			}
		}
	}

	return false;
}
 
Example 48
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateInvestigationsGridAndRecalculateContainers()
{
	// this takes the modified investigations from container choice dialog and repopulates the grid and does container calculation again
	if (form.getGlobalContext().OCRR.getReWrittenOrderInvestigationsIsNotNull())
	{
		OrderInvestigationVoCollection voCollRewrittenOrderInv = form.getGlobalContext().OCRR.getReWrittenOrderInvestigations();

		for (int i = 0; i < form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().size(); i++)
		{
			grdTestRow row = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().get(i);
			if (voCollRewrittenOrderInv.contains(row.getValue()))
				row.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(row.getValue())));

			for (int p = 0; p < row.getRows().size(); p++)
			{
				grdTestRow cRow = row.getRows().get(p);
				if (voCollRewrittenOrderInv.contains(cRow.getValue()))
					cRow.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(cRow.getValue())));
			}
		}
	}

	try
	{
		form.getGlobalContext().OCRR.setMyOrderPotentialSpecimens(null);
		btnGenerateSpecimensClick(-1);
	}
	catch (PresentationLogicException e)
	{
		e.printStackTrace();
	}
}
 
Example 49
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void cmPriorityValueChanged()
{
	if (form.lyrDetails().tabGenDetails().cmbPriority().getValue() != null && form.lyrDetails().tabGenDetails().cmbPriority().getValue().equals(OrderPriority.VARIOUS))
		return;

	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation == null)
		throw new CodingRuntimeException("Coding Error - OrderInvestigation Collection is null (onCmbPriorityValueChanged)");

	for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		voCollOrderInvestigation.get(i).setOrderPriority(form.lyrDetails().tabGenDetails().cmbPriority().getValue());

	form.getGlobalContext().OCRR.setOrderInvestigationCollection(voCollOrderInvestigation);
	setOrderPriorityInGrid();
}
 
Example 50
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void prePopulateRadPrintItems()
{
	OrderInvestigationVoCollection voCollOrderInv = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	SelectItemVoCollection voCollItems = new SelectItemVoCollection();

	if (voCollOrderInv != null)
	{
		for (int i = 0; i < voCollOrderInv.size(); i++)
		{
			if (voCollOrderInv.get(i).getInvestigationIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(Category.CLINICALIMAGING))
			{
				SelectItemVo voSelectItem = new SelectItemVo();
				voSelectItem.setItem(voCollOrderInv.get(i).getInvestigation().getInvestigationIndex());
				voSelectItem.setSelected(Boolean.FALSE);
				voCollItems.add(voSelectItem);
			}
		}
	}

	form.getGlobalContext().Core.setItems(voCollItems.size() > 0 ? voCollItems : null);

	InvestigationIndexRefVoCollection voCollInvIndex = new InvestigationIndexRefVoCollection();
	if (voCollItems != null)
	{
		for (int i = 0; i < voCollItems.size(); i++)
		{
			if (voCollItems.get(i).getItemIsNotNull())
			{
				if (voCollItems.get(i).getItem() instanceof InvestigationIndexLiteVo && voCollItems.get(i).getSelectedIsNotNull() && voCollItems.get(i).getSelected().equals(Boolean.FALSE))
				{
					voCollInvIndex.add((InvestigationIndexRefVo) voCollItems.get(i).getItem());
				}
			}
		}
	}
	form.getGlobalContext().OCRR.PrintOrder.setNotLocalInvestigations(voCollInvIndex.size() > 0 ? voCollInvIndex : null);
}
 
Example 51
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isTimeSeriesInvestigationIdentifier(Object identifier)
{
	if (identifier instanceof OrderInvestigationVoCollection)
	{
		OrderInvestigationVoCollection investigationCollection = (OrderInvestigationVoCollection) identifier;
		
		if (investigationCollection.size() == 1)
		{
			if (InvEventType.TIME_SERIES.equals(investigationCollection.get(0).getInvestigation().getEventType()))
				return true;
		}
	}

	return false;
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private InvestigationUnderSpecimenVo getInvestUnderSpecimenVoFromContextByOrderInvestigation(OrderInvestigationRefVo voOrderInvestigation)
{
	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation != null && voCollOrderInvestigation.size() > 0)
	{
		for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		{
			if (voCollOrderInvestigation.get(i).equals(voOrderInvestigation))
				return voCollOrderInvestigation.get(i).getInvestigation();
		}
	}
	return null;
}
 
Example 53
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isAnyAddOnsSelected()
{
	OrderInvestigationVoCollection voCollOrderInv = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getValues();
	for (int i = 0; i < voCollOrderInv.size(); i++)
	{
		if (voCollOrderInv.get(i) != null)
		{
			if (voCollOrderInv.get(i).getInvestigation().getIsAddonIsNotNull() && voCollOrderInv.get(i).getInvestigation().getIsAddon().booleanValue())
				return true;
		}
	}

	return false;
}
 
Example 54
Project: openMAXIMS   File: PathologyDialogImpl.java   Source Code and License 5 votes vote down vote up
public String getCentricityPacsAccessionNumber(OrderInvestigationRefVo voOrderInvRefVo) 
{
	if(voOrderInvRefVo == null || voOrderInvRefVo.getID_OrderInvestigation() == null)
		throw new DomainRuntimeException("Invalid OrderInvestigation id");
	
	if(voOrderInvRefVo != null)
	{
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" select o1_1 from OrderInvestigation as o1_1 where  "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + " o1_1.id  = :OrderInvId");
			markers.add("OrderInvId");
		values.add(voOrderInvRefVo.getID_OrderInvestigation());
		andStr = " and ";	

		List<?> list = factory.find(hql.toString(), markers,values);
		if(list != null && list.size() > 0)
		{ 
			OrderInvestigationVoCollection voColl = OrderInvestigationVoAssembler.createOrderInvestigationVoCollectionFromOrderInvestigation(list);
			if(voColl != null && voColl.size() > 0)
				return voColl.get(0).getAccessionNumber();
		}
	}
	return null;
}
 
Example 55
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateSpecimensWithAlternateContainers(OrderSpecimenVoCollection potentialSpecimens, HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers)
{
	// Clear grid
	form.grdItems().getRows().clear();
	
	if (potentialSpecimens == null)
		return;

	for (OrderSpecimenVo specimen : potentialSpecimens)
	{
		HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers = alternativeContainers.get(specimen);
		
		if (specimenHasOptions(specimenAlternateContainers))
		{
			// Create Specimen parent row
			grdItemsRow specimenRow = form.grdItems().getRows().newRow();

			// Add investigation rows
			float totalRequiredVolume = addInvestigationsWithAlternates(specimen.getInvestigations(), specimenRow, specimenAlternateContainers);

			// Set specimen text
			specimenRow.setColText(getSpecimenDisplayText(specimen, totalRequiredVolume));
			// Expand Specimen parent row
			specimenRow.setExpanded(true);
		}
	}
}
 
Example 56
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean choicesAvailable(HashMap<OrderSpecimenVo, HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> alternativeContainers)
{
	Collection<HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection>> specimenMaps = alternativeContainers.values();
	
	for (HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenMap : specimenMaps)
	{
		if (specimenHasOptions(specimenMap))
			return true;
	}

	return false;
}
 
Example 57
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean specimenHasOptions(HashMap<PathSpecimenContainerDetailVo, OrderInvestigationVoCollection> specimenAlternateContainers)
{
	Set<PathSpecimenContainerDetailVo> keys = specimenAlternateContainers.keySet();
	
	for (PathSpecimenContainerDetailVo specimenContainer : keys)
	{
		OrderInvestigationVoCollection values = specimenAlternateContainers.get(specimenContainer);
		
		if (values != null && values.size() > 1)
		{
			for (OrderInvestigationVo investigation : values)
			{
				PathInvDetailsVo pathologyDetails = null;
				
				if (investigation.getInvestigation().getParentInvestigationPathDetails() != null)
				{
					pathologyDetails = investigation.getInvestigation().getParentInvestigationPathDetails();
				}
				else
				{
					pathologyDetails = investigation.getInvestigation().getPathInvDetails();
				}
				
				SpecimenVo specimenVo = pathologyDetails.getSpecimens().get(0);
				
				if (specimenVo.getAlternativePaediatricContainers() != null)
				{
					for (SpecimenContainerVo container : specimenVo.getAlternativePaediatricContainers())
					{
						if (container.getSpecContainer().equals(specimenContainer))
							return true;
					}
				}
			}
		}
	}

	return false;
}
 
Example 58
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateInvestigationsGridAndRecalculateContainers()
{
	// this takes the modified investigations from container choice dialog and repopulates the grid and does container calculation again
	if (form.getGlobalContext().OCRR.getReWrittenOrderInvestigationsIsNotNull())
	{
		OrderInvestigationVoCollection voCollRewrittenOrderInv = form.getGlobalContext().OCRR.getReWrittenOrderInvestigations();

		for (int i = 0; i < form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().size(); i++)
		{
			grdTestRow row = form.lyrDetails().tabPathDetails().lyrPathology().tabRequestedTests().grdTest().getRows().get(i);
			if (voCollRewrittenOrderInv.contains(row.getValue()))
				row.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(row.getValue())));

			for (int p = 0; p < row.getRows().size(); p++)
			{
				grdTestRow cRow = row.getRows().get(p);
				if (voCollRewrittenOrderInv.contains(cRow.getValue()))
					cRow.setValue(voCollRewrittenOrderInv.get(voCollRewrittenOrderInv.indexOf(cRow.getValue())));
			}
		}
	}

	try
	{
		form.getGlobalContext().OCRR.setMyOrderPotentialSpecimens(null);
		btnGenerateSpecimensClick(-1);
	}
	catch (PresentationLogicException e)
	{
		e.printStackTrace();
	}
}
 
Example 59
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void cmPriorityValueChanged()
{
	if (form.lyrDetails().tabGenDetails().cmbPriority().getValue() != null && form.lyrDetails().tabGenDetails().cmbPriority().getValue().equals(OrderPriority.VARIOUS))
		return;

	OrderInvestigationVoCollection voCollOrderInvestigation = form.getGlobalContext().OCRR.getOrderInvestigationCollection();
	if (voCollOrderInvestigation == null)
		throw new CodingRuntimeException("Coding Error - OrderInvestigation Collection is null (onCmbPriorityValueChanged)");

	for (int i = 0; i < voCollOrderInvestigation.size(); i++)
		voCollOrderInvestigation.get(i).setOrderPriority(form.lyrDetails().tabGenDetails().cmbPriority().getValue());

	form.getGlobalContext().OCRR.setOrderInvestigationCollection(voCollOrderInvestigation);
	setOrderPriorityInGrid();
}
 
Example 60
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void prePopulateRadPrintItems()
{
	OrderInvestigationVoCollection voCollOrderInv = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	SelectItemVoCollection voCollItems = new SelectItemVoCollection();

	if (voCollOrderInv != null)
	{
		for (int i = 0; i < voCollOrderInv.size(); i++)
		{
			if (voCollOrderInv.get(i).getInvestigationIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInv.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(Category.CLINICALIMAGING))
			{
				SelectItemVo voSelectItem = new SelectItemVo();
				voSelectItem.setItem(voCollOrderInv.get(i).getInvestigation().getInvestigationIndex());
				voSelectItem.setSelected(Boolean.FALSE);
				voCollItems.add(voSelectItem);
			}
		}
	}

	form.getGlobalContext().Core.setItems(voCollItems.size() > 0 ? voCollItems : null);

	InvestigationIndexRefVoCollection voCollInvIndex = new InvestigationIndexRefVoCollection();
	if (voCollItems != null)
	{
		for (int i = 0; i < voCollItems.size(); i++)
		{
			if (voCollItems.get(i).getItemIsNotNull())
			{
				if (voCollItems.get(i).getItem() instanceof InvestigationIndexLiteVo && voCollItems.get(i).getSelectedIsNotNull() && voCollItems.get(i).getSelected().equals(Boolean.FALSE))
				{
					voCollInvIndex.add((InvestigationIndexRefVo) voCollItems.get(i).getItem());
				}
			}
		}
	}
	form.getGlobalContext().OCRR.PrintOrder.setNotLocalInvestigations(voCollInvIndex.size() > 0 ? voCollInvIndex : null);
}