Java Code Examples for ims.icp.vo.ICPPhaseDisplayVo

The following are top voted examples for showing how to use ims.icp.vo.ICPPhaseDisplayVo. 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   View source code 6 votes vote down vote up
public int compare(Object arg0, Object arg1)
{
	if (arg0 instanceof PatientICPPhasesLiteVo && arg1 instanceof PatientICPPhasesLiteVo)
	{
		return ((PatientICPPhasesLiteVo) arg0).getPhase().getSequence().compareTo(((PatientICPPhasesLiteVo) arg1).getPhase().getSequence());
	}
	
	if (arg0 instanceof ICPPhaseDisplayVo && arg1 instanceof ICPPhaseDisplayVo)
	{
		return ((ICPPhaseDisplayVo)arg0).getSequence().compareTo(((ICPPhaseDisplayVo)arg1).getSequence());
	}
	
	if (arg0 instanceof PatientICPPhasesLiteVo && arg1 instanceof ICPPhaseDisplayVo)
	{
		return ((PatientICPPhasesLiteVo) arg0).getPhase().getSequence().compareTo(((ICPPhaseDisplayVo)arg1).getSequence());
	}
	
	if (arg0 instanceof ICPPhaseDisplayVo && arg1 instanceof PatientICPPhasesLiteVo)
	{
		return ((ICPPhaseDisplayVo)arg0).getSequence().compareTo(((PatientICPPhasesLiteVo) arg1).getPhase().getSequence());
	}

	return 0;
}
 
Example 2
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public int compare(Object arg0, Object arg1)
{
	if (arg0 instanceof PatientICPPhasesLiteVo && arg1 instanceof PatientICPPhasesLiteVo)
	{
		return ((PatientICPPhasesLiteVo) arg0).getPhase().getSequence().compareTo(((PatientICPPhasesLiteVo) arg1).getPhase().getSequence());
	}
	
	if (arg0 instanceof ICPPhaseDisplayVo && arg1 instanceof ICPPhaseDisplayVo)
	{
		return ((ICPPhaseDisplayVo)arg0).getSequence().compareTo(((ICPPhaseDisplayVo)arg1).getSequence());
	}
	
	if (arg0 instanceof PatientICPPhasesLiteVo && arg1 instanceof ICPPhaseDisplayVo)
	{
		return ((PatientICPPhasesLiteVo) arg0).getPhase().getSequence().compareTo(((ICPPhaseDisplayVo)arg1).getSequence());
	}
	
	if (arg0 instanceof ICPPhaseDisplayVo && arg1 instanceof PatientICPPhasesLiteVo)
	{
		return ((ICPPhaseDisplayVo)arg0).getSequence().compareTo(((PatientICPPhasesLiteVo) arg1).getPhase().getSequence());
	}

	return 0;
}
 
Example 3
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public int compare(Object arg0, Object arg1)
{
	if (arg0 instanceof PatientICPPhasesLiteVo && arg1 instanceof PatientICPPhasesLiteVo)
	{
		return ((PatientICPPhasesLiteVo) arg0).getPhase().getSequence().compareTo(((PatientICPPhasesLiteVo) arg1).getPhase().getSequence());
	}
	
	if (arg0 instanceof ICPPhaseDisplayVo && arg1 instanceof ICPPhaseDisplayVo)
	{
		return ((ICPPhaseDisplayVo)arg0).getSequence().compareTo(((ICPPhaseDisplayVo)arg1).getSequence());
	}
	
	if (arg0 instanceof PatientICPPhasesLiteVo && arg1 instanceof ICPPhaseDisplayVo)
	{
		return ((PatientICPPhasesLiteVo) arg0).getPhase().getSequence().compareTo(((ICPPhaseDisplayVo)arg1).getSequence());
	}
	
	if (arg0 instanceof ICPPhaseDisplayVo && arg1 instanceof PatientICPPhasesLiteVo)
	{
		return ((ICPPhaseDisplayVo)arg0).getSequence().compareTo(((PatientICPPhasesLiteVo) arg1).getPhase().getSequence());
	}

	return 0;
}
 
Example 4
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
public int compare(Object arg0, Object arg1)
{
	if (arg0 instanceof PatientICPPhasesLiteVo && arg1 instanceof PatientICPPhasesLiteVo)
	{
		return ((PatientICPPhasesLiteVo) arg0).getPhase().getSequence().compareTo(((PatientICPPhasesLiteVo) arg1).getPhase().getSequence());
	}
	
	if (arg0 instanceof ICPPhaseDisplayVo && arg1 instanceof ICPPhaseDisplayVo)
	{
		return ((ICPPhaseDisplayVo)arg0).getSequence().compareTo(((ICPPhaseDisplayVo)arg1).getSequence());
	}
	
	if (arg0 instanceof PatientICPPhasesLiteVo && arg1 instanceof ICPPhaseDisplayVo)
	{
		return ((PatientICPPhasesLiteVo) arg0).getPhase().getSequence().compareTo(((ICPPhaseDisplayVo)arg1).getSequence());
	}
	
	if (arg0 instanceof ICPPhaseDisplayVo && arg1 instanceof PatientICPPhasesLiteVo)
	{
		return ((ICPPhaseDisplayVo)arg0).getSequence().compareTo(((PatientICPPhasesLiteVo) arg1).getPhase().getSequence());
	}

	return 0;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * Function used to populate full phases to an ICP Stage node (Action)
 * 
 * @param node
 * @param phaseCollection
 */
private void populateTreeFullICPPhase(TreeNode node, ICPPhaseDisplayVoCollection phaseCollection)
{
	// Clear node
	node.getNodes().clear();

	// Check the phase collection
	if (phaseCollection == null || phaseCollection.size() == 0)
		return;

	phaseCollection.sort(new PhaseComparator());

	// Iterate ICP Phases collection
	for (ICPPhaseDisplayVo phase : phaseCollection)
	{
		// Skip null ICP Phase
		if (phase == null)
			continue;

		// Add ICP Phase value to ICP Stage node
		TreeNode phaseNode = node.getNodes().add((ICPPhaseLiteVo) phase, phase.getName());

		// Set node images, gray text for inactive stage, collapse node and
		// add actions nodes
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);

		if (PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()))
		{
			phaseNode.setTextColor(Color.Gray);
		}

		populateTreeICPActionNodes(phaseNode, phase.getActions());

		phaseNode.setExpanded(true);
		phaseNode.setIdentifier(EXPANDED);
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateTreePhases(TreeNode node, ICPPhaseDisplayVoCollection phaseCollection)
{
	// Clear the nodes
	node.getNodes().clear();
	
	// Terminate function if collection is null
	if (phaseCollection == null)
		return;
	
	// Sort phase collection after sequence
	phaseCollection.sort(new PhaseComparator());
	
	// Iterate phase collection
	for (int i = 0; i < phaseCollection.size(); i++)
	{
		ICPPhaseDisplayVo phase = phaseCollection.get(i);
	
		// Skip null phases
		if (phase == null)
			continue;
	
		// Add phase node to ICP
		TreeNode phaseNode = node.getNodes().add(phase, phase.getName() + " (" + phase.getID_ICPPhase().toString() + ")");
	
		// Set node images, gray text for inactive
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
	
		// Populate node actions
		populateTreeAction(phaseNode, phase.getActions());
	
		// Expand node
		phaseNode.setExpanded(true);
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
public int compare(ICPPhaseDisplayVo phaseOne, ICPPhaseDisplayVo phaseTwo)
{
	if (phaseOne.getSequenceIsNotNull())
		return phaseOne.getSequence().compareTo(phaseTwo.getSequence());
	
	if (phaseTwo.getSequenceIsNotNull())
		return phaseTwo.getSequence().compareTo(phaseOne.getSequence());
	
	return 0;
}
 
Example 8
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
/**
 * Function used to populate full phases to an ICP Stage node (Action)
 * 
 * @param node
 * @param phaseCollection
 */
private void populateTreeFullICPPhase(TreeNode node, ICPPhaseDisplayVoCollection phaseCollection)
{
	// Clear node
	node.getNodes().clear();

	// Check the phase collection
	if (phaseCollection == null || phaseCollection.size() == 0)
		return;

	phaseCollection.sort(new PhaseComparator());

	// Iterate ICP Phases collection
	for (ICPPhaseDisplayVo phase : phaseCollection)
	{
		// Skip null ICP Phase
		if (phase == null)
			continue;

		// Add ICP Phase value to ICP Stage node
		TreeNode phaseNode = node.getNodes().add((ICPPhaseLiteVo) phase, phase.getName());

		// Set node images, gray text for inactive stage, collapse node and
		// add actions nodes
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);

		if (PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()))
		{
			phaseNode.setTextColor(Color.Gray);
		}

		populateTreeICPActionNodes(phaseNode, phase.getActions());

		phaseNode.setExpanded(true);
		phaseNode.setIdentifier(EXPANDED);
	}
}
 
Example 9
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateTreePhases(TreeNode node, ICPPhaseDisplayVoCollection phaseCollection)
{
	// Clear the nodes
	node.getNodes().clear();
	
	// Terminate function if collection is null
	if (phaseCollection == null)
		return;
	
	// Sort phase collection after sequence
	phaseCollection.sort(new PhaseComparator());
	
	// Iterate phase collection
	for (int i = 0; i < phaseCollection.size(); i++)
	{
		ICPPhaseDisplayVo phase = phaseCollection.get(i);
	
		// Skip null phases
		if (phase == null)
			continue;
	
		// Add phase node to ICP
		TreeNode phaseNode = node.getNodes().add(phase, phase.getName() + " (" + phase.getID_ICPPhase().toString() + ")");
	
		// Set node images, gray text for inactive
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
	
		// Populate node actions
		populateTreeAction(phaseNode, phase.getActions());
	
		// Expand node
		phaseNode.setExpanded(true);
	}
}
 
Example 10
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
public int compare(ICPPhaseDisplayVo phaseOne, ICPPhaseDisplayVo phaseTwo)
{
	if (phaseOne.getSequenceIsNotNull())
		return phaseOne.getSequence().compareTo(phaseTwo.getSequence());
	
	if (phaseTwo.getSequenceIsNotNull())
		return phaseTwo.getSequence().compareTo(phaseOne.getSequence());
	
	return 0;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
/**
 * Function used to populate full phases to an ICP Stage node (Action)
 * 
 * @param node
 * @param phaseCollection
 */
private void populateTreeFullICPPhase(TreeNode node, ICPPhaseDisplayVoCollection phaseCollection)
{
	// Clear node
	node.getNodes().clear();

	// Check the phase collection
	if (phaseCollection == null || phaseCollection.size() == 0)
		return;

	phaseCollection.sort(new PhaseComparator());

	// Iterate ICP Phases collection
	for (ICPPhaseDisplayVo phase : phaseCollection)
	{
		// Skip null ICP Phase
		if (phase == null)
			continue;

		// Add ICP Phase value to ICP Stage node
		TreeNode phaseNode = node.getNodes().add((ICPPhaseLiteVo) phase, phase.getName());

		// Set node images, gray text for inactive stage, collapse node and
		// add actions nodes
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);

		if (PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()))
		{
			phaseNode.setTextColor(Color.Gray);
		}

		populateTreeICPActionNodes(phaseNode, phase.getActions());

		phaseNode.setExpanded(true);
		phaseNode.setIdentifier(EXPANDED);
	}
}
 
Example 12
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateTreePhases(TreeNode node, ICPPhaseDisplayVoCollection phaseCollection)
{
	// Clear the nodes
	node.getNodes().clear();
	
	// Terminate function if collection is null
	if (phaseCollection == null)
		return;
	
	// Sort phase collection after sequence
	phaseCollection.sort(new PhaseComparator());
	
	// Iterate phase collection
	for (int i = 0; i < phaseCollection.size(); i++)
	{
		ICPPhaseDisplayVo phase = phaseCollection.get(i);
	
		// Skip null phases
		if (phase == null)
			continue;
	
		// Add phase node to ICP
		TreeNode phaseNode = node.getNodes().add(phase, phase.getName() + " (" + phase.getID_ICPPhase().toString() + ")");
	
		// Set node images, gray text for inactive
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
	
		// Populate node actions
		populateTreeAction(phaseNode, phase.getActions());
	
		// Expand node
		phaseNode.setExpanded(true);
	}
}
 
Example 13
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
public int compare(ICPPhaseDisplayVo phaseOne, ICPPhaseDisplayVo phaseTwo)
{
	if (phaseOne.getSequenceIsNotNull())
		return phaseOne.getSequence().compareTo(phaseTwo.getSequence());
	
	if (phaseTwo.getSequenceIsNotNull())
		return phaseTwo.getSequence().compareTo(phaseOne.getSequence());
	
	return 0;
}
 
Example 14
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
/**
 * Function used to populate full phases to an ICP Stage node (Action)
 * 
 * @param node
 * @param phaseCollection
 */
private void populateTreeFullICPPhase(TreeNode node, ICPPhaseDisplayVoCollection phaseCollection)
{
	// Clear node
	node.getNodes().clear();

	// Check the phase collection
	if (phaseCollection == null || phaseCollection.size() == 0)
		return;

	phaseCollection.sort(new PhaseComparator());

	// Iterate ICP Phases collection
	for (ICPPhaseDisplayVo phase : phaseCollection)
	{
		// Skip null ICP Phase
		if (phase == null)
			continue;

		// Add ICP Phase value to ICP Stage node
		TreeNode phaseNode = node.getNodes().add((ICPPhaseLiteVo) phase, phase.getName());

		// Set node images, gray text for inactive stage, collapse node and
		// add actions nodes
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);

		if (PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()))
		{
			phaseNode.setTextColor(Color.Gray);
		}

		populateTreeICPActionNodes(phaseNode, phase.getActions());

		phaseNode.setExpanded(true);
		phaseNode.setIdentifier(EXPANDED);
	}
}
 
Example 15
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
private void populateTreePhases(TreeNode node, ICPPhaseDisplayVoCollection phaseCollection)
{
	// Clear the nodes
	node.getNodes().clear();
	
	// Terminate function if collection is null
	if (phaseCollection == null)
		return;
	
	// Sort phase collection after sequence
	phaseCollection.sort(new PhaseComparator());
	
	// Iterate phase collection
	for (int i = 0; i < phaseCollection.size(); i++)
	{
		ICPPhaseDisplayVo phase = phaseCollection.get(i);
	
		// Skip null phases
		if (phase == null)
			continue;
	
		// Add phase node to ICP
		TreeNode phaseNode = node.getNodes().add(phase, phase.getName() + " (" + phase.getID_ICPPhase().toString() + ")");
	
		// Set node images, gray text for inactive
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
	
		// Populate node actions
		populateTreeAction(phaseNode, phase.getActions());
	
		// Expand node
		phaseNode.setExpanded(true);
	}
}
 
Example 16
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
public int compare(ICPPhaseDisplayVo phaseOne, ICPPhaseDisplayVo phaseTwo)
{
	if (phaseOne.getSequenceIsNotNull())
		return phaseOne.getSequence().compareTo(phaseTwo.getSequence());
	
	if (phaseTwo.getSequenceIsNotNull())
		return phaseTwo.getSequence().compareTo(phaseOne.getSequence());
	
	return 0;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void populateConfigurationICPStage(grdActionsRow row, ICPStageDisplayVo stage)
{
	// Check row
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate null row (in function populateConfigurationICPStage");

	// Check stage
	if (stage == null)
		return;

	// Add stage name
	row.setColAction(stage.getNameIsNotNull() ? stage.getName() : "");

	// Add stage to row value
	row.setValue(stage);

	// Set images
	row.setExpandedImage(form.getImages().ICP.Stage);
	row.setCollapsedImage(form.getImages().ICP.Stage);

	// Set row as selectable, read-only
	row.setSelectable(!PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) && "S".equalsIgnoreCase(form.getGlobalContext().ICP.getTypeToSelect()));
	row.setReadOnly(true);
	
	// Set colors
	row.setBackColor(Color.Beige);
	row.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) ? Color.Gray : Color.Black);
	

	// Test stage phases
	if (stage.getPhasesIsNotNull())
	{
		// Sort the phases
		stage.getPhases().sort(new PhaseComparator());

		// Iterate phases
		for (ICPPhaseDisplayVo phase : stage.getPhases())
		{
			if (phase == null)
				continue;

			// Add phase to stage row
			populateConfigurationICPPhase(row.getRows().newRow(), phase);
		}
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void populateConfigurationICPPhase(grdActionsRow row, ICPPhaseDisplayVo phase)
{
	// Check row
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error = Can not populate null row (in function populateConfigurationICPPhase");
	
	// Check phase
	if (phase == null)
		return;
	
	// Add phase name
	row.setColAction(phase.getNameIsNotNull() ? phase.getName() : "");
	
	// Add phase to row value
	row.setValue(phase);
	
	// Set images
	row.setExpandedImage(form.getImages().ICP.Phase);
	row.setCollapsedImage(form.getImages().ICP.Phase);
	
	// Set row as selectable, read-only
	row.setSelectable(!PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) && "P".equalsIgnoreCase(form.getGlobalContext().ICP.getTypeToSelect()));
	row.setReadOnly(true);
	
	// Set colors
	row.setBackColor(Color.Beige);
	row.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
	
	// KEEP CODE AS ACTIONS MIGHT BE USED IN THE FUTURE
	
	// Test phase actions
	if (phase.getActionsIsNotNull())
	{
		// Sort the actions
		phase.getActions().sort(new ActionComparator());
		
		// Iterate actions
		for (ICPActionLiteVo action : phase.getActions())
		{
			if (action == null)
				continue;
			
			// Add action to phase row
			populateConfigurationICPAction(row.getRows().newRow(), action);
		}
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private boolean hasPhasesNotAdded()
{
	// Get Patient ICP
	PatientICPViewVo patientICP = form.getLocalContext().getCurrentPatientICP();

	// If no patient ICP exits or configuration ICP is not present -> NO
	// Phases to add
	if (patientICP == null || !patientICP.getICPIsNotNull())
		return false;

	// Get Configuration ICP
	ICPConfigurationDisplayVo configurationICP = form.getLocalContext().getConfigurationICP();

	// If no configuration ICP exits or configuration ICP has no stages ->
	// NO Phases to add
	if (configurationICP == null || !configurationICP.getStagesIsNotNull() || PreActiveActiveInactiveStatus.INACTIVE.equals(configurationICP.getStatus()))
		return false;

	// Sort configuration stages
	configurationICP.getStages().sort(new StageComparator());

	// Iterate configuration stages
	for (ICPStageDisplayVo stage : configurationICP.getStages())
	{
		// Check stage status
		if (stage == null || !PreActiveActiveInactiveStatus.ACTIVE.equals(stage.getStatus()) || !stage.getPhasesIsNotNull())
			continue;

		// Sort configuration phases
		stage.getPhases().sort(new PhaseComparator());

		// Iterate configuration phases
		for (ICPPhaseDisplayVo phase : stage.getPhases())
		{
			// Check phase status
			if (phase == null || !PreActiveActiveInactiveStatus.ACTIVE.equals(phase.getStatus()))
				continue;

			if (!findPhaseInPatientICP((ICPPhaseLiteVo) phase, patientICP.getStages()))
				return true;
		}
	}

	return false;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void populateICPPhases(TreeNode stageNode, ICPPhaseDisplayVoCollection phases, String filterValue)
{
	// Terminate function if phase collection is null
	if (phases == null)
		return;
	
	// Sort phases
	phases.sort(new PhaseComparator());
	
	for (int i = 0; i < phases.size(); i++)
	{
		ICPPhaseDisplayVo phase = phases.get(i);
		
		if (phases == null)
			continue;
		
		// Add phase to stage node
		TreeNode phaseNode = stageNode.getNodes().add(phase, phase.getName());
		phaseNode.setCheckBoxVisible(false);
		phaseNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
		
		// Set node images
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
		phaseNode.setSelectedImage(form.getImages().ICP.Phase);
		
		// Add ICP Actions
		populateICPActions(phaseNode, phase.getActions(), filterValue);
		
		// Check to see if the node has child, else remove it
		if (filterValue == null || phaseNode.getNodes().size() > 0)
		{
			// Expand the node
			phaseNode.setExpanded(true);
		}
		else
		{
			stageNode.getNodes().remove(phaseNode);
		}
	}
	
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void populateConfigurationICPStage(grdActionsRow row, ICPStageDisplayVo stage)
{
	// Check row
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate null row (in function populateConfigurationICPStage");

	// Check stage
	if (stage == null)
		return;

	// Add stage name
	row.setColAction(stage.getNameIsNotNull() ? stage.getName() : "");

	// Add stage to row value
	row.setValue(stage);

	// Set images
	row.setExpandedImage(form.getImages().ICP.Stage);
	row.setCollapsedImage(form.getImages().ICP.Stage);

	// Set row as selectable, read-only
	row.setSelectable(!PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) && "S".equalsIgnoreCase(form.getGlobalContext().ICP.getTypeToSelect()));
	row.setReadOnly(true);
	
	// Set colors
	row.setBackColor(Color.Beige);
	row.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) ? Color.Gray : Color.Black);
	

	// Test stage phases
	if (stage.getPhasesIsNotNull())
	{
		// Sort the phases
		stage.getPhases().sort(new PhaseComparator());

		// Iterate phases
		for (ICPPhaseDisplayVo phase : stage.getPhases())
		{
			if (phase == null)
				continue;

			// Add phase to stage row
			populateConfigurationICPPhase(row.getRows().newRow(), phase);
		}
	}
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void populateConfigurationICPPhase(grdActionsRow row, ICPPhaseDisplayVo phase)
{
	// Check row
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error = Can not populate null row (in function populateConfigurationICPPhase");
	
	// Check phase
	if (phase == null)
		return;
	
	// Add phase name
	row.setColAction(phase.getNameIsNotNull() ? phase.getName() : "");
	
	// Add phase to row value
	row.setValue(phase);
	
	// Set images
	row.setExpandedImage(form.getImages().ICP.Phase);
	row.setCollapsedImage(form.getImages().ICP.Phase);
	
	// Set row as selectable, read-only
	row.setSelectable(!PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) && "P".equalsIgnoreCase(form.getGlobalContext().ICP.getTypeToSelect()));
	row.setReadOnly(true);
	
	// Set colors
	row.setBackColor(Color.Beige);
	row.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
	
	// KEEP CODE AS ACTIONS MIGHT BE USED IN THE FUTURE
	
	// Test phase actions
	if (phase.getActionsIsNotNull())
	{
		// Sort the actions
		phase.getActions().sort(new ActionComparator());
		
		// Iterate actions
		for (ICPActionLiteVo action : phase.getActions())
		{
			if (action == null)
				continue;
			
			// Add action to phase row
			populateConfigurationICPAction(row.getRows().newRow(), action);
		}
	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private boolean hasPhasesNotAdded()
{
	// Get Patient ICP
	PatientICPViewVo patientICP = form.getLocalContext().getCurrentPatientICP();

	// If no patient ICP exits or configuration ICP is not present -> NO
	// Phases to add
	if (patientICP == null || !patientICP.getICPIsNotNull())
		return false;

	// Get Configuration ICP
	ICPConfigurationDisplayVo configurationICP = form.getLocalContext().getConfigurationICP();

	// If no configuration ICP exits or configuration ICP has no stages ->
	// NO Phases to add
	if (configurationICP == null || !configurationICP.getStagesIsNotNull() || PreActiveActiveInactiveStatus.INACTIVE.equals(configurationICP.getStatus()))
		return false;

	// Sort configuration stages
	configurationICP.getStages().sort(new StageComparator());

	// Iterate configuration stages
	for (ICPStageDisplayVo stage : configurationICP.getStages())
	{
		// Check stage status
		if (stage == null || !PreActiveActiveInactiveStatus.ACTIVE.equals(stage.getStatus()) || !stage.getPhasesIsNotNull())
			continue;

		// Sort configuration phases
		stage.getPhases().sort(new PhaseComparator());

		// Iterate configuration phases
		for (ICPPhaseDisplayVo phase : stage.getPhases())
		{
			// Check phase status
			if (phase == null || !PreActiveActiveInactiveStatus.ACTIVE.equals(phase.getStatus()))
				continue;

			if (!findPhaseInPatientICP((ICPPhaseLiteVo) phase, patientICP.getStages()))
				return true;
		}
	}

	return false;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void populateICPPhases(TreeNode stageNode, ICPPhaseDisplayVoCollection phases, String filterValue)
{
	// Terminate function if phase collection is null
	if (phases == null)
		return;
	
	// Sort phases
	phases.sort(new PhaseComparator());
	
	for (int i = 0; i < phases.size(); i++)
	{
		ICPPhaseDisplayVo phase = phases.get(i);
		
		if (phases == null)
			continue;
		
		// Add phase to stage node
		TreeNode phaseNode = stageNode.getNodes().add(phase, phase.getName());
		phaseNode.setCheckBoxVisible(false);
		phaseNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
		
		// Set node images
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
		phaseNode.setSelectedImage(form.getImages().ICP.Phase);
		
		// Add ICP Actions
		populateICPActions(phaseNode, phase.getActions(), filterValue);
		
		// Check to see if the node has child, else remove it
		if (filterValue == null || phaseNode.getNodes().size() > 0)
		{
			// Expand the node
			phaseNode.setExpanded(true);
		}
		else
		{
			stageNode.getNodes().remove(phaseNode);
		}
	}
	
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void populateConfigurationICPStage(grdActionsRow row, ICPStageDisplayVo stage)
{
	// Check row
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate null row (in function populateConfigurationICPStage");

	// Check stage
	if (stage == null)
		return;

	// Add stage name
	row.setColAction(stage.getNameIsNotNull() ? stage.getName() : "");

	// Add stage to row value
	row.setValue(stage);

	// Set images
	row.setExpandedImage(form.getImages().ICP.Stage);
	row.setCollapsedImage(form.getImages().ICP.Stage);

	// Set row as selectable, read-only
	row.setSelectable(!PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) && "S".equalsIgnoreCase(form.getGlobalContext().ICP.getTypeToSelect()));
	row.setReadOnly(true);
	
	// Set colors
	row.setBackColor(Color.Beige);
	row.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) ? Color.Gray : Color.Black);
	

	// Test stage phases
	if (stage.getPhasesIsNotNull())
	{
		// Sort the phases
		stage.getPhases().sort(new PhaseComparator());

		// Iterate phases
		for (ICPPhaseDisplayVo phase : stage.getPhases())
		{
			if (phase == null)
				continue;

			// Add phase to stage row
			populateConfigurationICPPhase(row.getRows().newRow(), phase);
		}
	}
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void populateConfigurationICPPhase(grdActionsRow row, ICPPhaseDisplayVo phase)
{
	// Check row
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error = Can not populate null row (in function populateConfigurationICPPhase");
	
	// Check phase
	if (phase == null)
		return;
	
	// Add phase name
	row.setColAction(phase.getNameIsNotNull() ? phase.getName() : "");
	
	// Add phase to row value
	row.setValue(phase);
	
	// Set images
	row.setExpandedImage(form.getImages().ICP.Phase);
	row.setCollapsedImage(form.getImages().ICP.Phase);
	
	// Set row as selectable, read-only
	row.setSelectable(!PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) && "P".equalsIgnoreCase(form.getGlobalContext().ICP.getTypeToSelect()));
	row.setReadOnly(true);
	
	// Set colors
	row.setBackColor(Color.Beige);
	row.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
	
	// KEEP CODE AS ACTIONS MIGHT BE USED IN THE FUTURE
	
	// Test phase actions
	if (phase.getActionsIsNotNull())
	{
		// Sort the actions
		phase.getActions().sort(new ActionComparator());
		
		// Iterate actions
		for (ICPActionLiteVo action : phase.getActions())
		{
			if (action == null)
				continue;
			
			// Add action to phase row
			populateConfigurationICPAction(row.getRows().newRow(), action);
		}
	}
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private boolean hasPhasesNotAdded()
{
	// Get Patient ICP
	PatientICPViewVo patientICP = form.getLocalContext().getCurrentPatientICP();

	// If no patient ICP exits or configuration ICP is not present -> NO
	// Phases to add
	if (patientICP == null || !patientICP.getICPIsNotNull())
		return false;

	// Get Configuration ICP
	ICPConfigurationDisplayVo configurationICP = form.getLocalContext().getConfigurationICP();

	// If no configuration ICP exits or configuration ICP has no stages ->
	// NO Phases to add
	if (configurationICP == null || !configurationICP.getStagesIsNotNull() || PreActiveActiveInactiveStatus.INACTIVE.equals(configurationICP.getStatus()))
		return false;

	// Sort configuration stages
	configurationICP.getStages().sort(new StageComparator());

	// Iterate configuration stages
	for (ICPStageDisplayVo stage : configurationICP.getStages())
	{
		// Check stage status
		if (stage == null || !PreActiveActiveInactiveStatus.ACTIVE.equals(stage.getStatus()) || !stage.getPhasesIsNotNull())
			continue;

		// Sort configuration phases
		stage.getPhases().sort(new PhaseComparator());

		// Iterate configuration phases
		for (ICPPhaseDisplayVo phase : stage.getPhases())
		{
			// Check phase status
			if (phase == null || !PreActiveActiveInactiveStatus.ACTIVE.equals(phase.getStatus()))
				continue;

			if (!findPhaseInPatientICP((ICPPhaseLiteVo) phase, patientICP.getStages()))
				return true;
		}
	}

	return false;
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void populateICPPhases(TreeNode stageNode, ICPPhaseDisplayVoCollection phases, String filterValue)
{
	// Terminate function if phase collection is null
	if (phases == null)
		return;
	
	// Sort phases
	phases.sort(new PhaseComparator());
	
	for (int i = 0; i < phases.size(); i++)
	{
		ICPPhaseDisplayVo phase = phases.get(i);
		
		if (phases == null)
			continue;
		
		// Add phase to stage node
		TreeNode phaseNode = stageNode.getNodes().add(phase, phase.getName());
		phaseNode.setCheckBoxVisible(false);
		phaseNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
		
		// Set node images
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
		phaseNode.setSelectedImage(form.getImages().ICP.Phase);
		
		// Add ICP Actions
		populateICPActions(phaseNode, phase.getActions(), filterValue);
		
		// Check to see if the node has child, else remove it
		if (filterValue == null || phaseNode.getNodes().size() > 0)
		{
			// Expand the node
			phaseNode.setExpanded(true);
		}
		else
		{
			stageNode.getNodes().remove(phaseNode);
		}
	}
	
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void populateConfigurationICPStage(grdActionsRow row, ICPStageDisplayVo stage)
{
	// Check row
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate null row (in function populateConfigurationICPStage");

	// Check stage
	if (stage == null)
		return;

	// Add stage name
	row.setColAction(stage.getNameIsNotNull() ? stage.getName() : "");

	// Add stage to row value
	row.setValue(stage);

	// Set images
	row.setExpandedImage(form.getImages().ICP.Stage);
	row.setCollapsedImage(form.getImages().ICP.Stage);

	// Set row as selectable, read-only
	row.setSelectable(!PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) && "S".equalsIgnoreCase(form.getGlobalContext().ICP.getTypeToSelect()));
	row.setReadOnly(true);
	
	// Set colors
	row.setBackColor(Color.Beige);
	row.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) ? Color.Gray : Color.Black);
	

	// Test stage phases
	if (stage.getPhasesIsNotNull())
	{
		// Sort the phases
		stage.getPhases().sort(new PhaseComparator());

		// Iterate phases
		for (ICPPhaseDisplayVo phase : stage.getPhases())
		{
			if (phase == null)
				continue;

			// Add phase to stage row
			populateConfigurationICPPhase(row.getRows().newRow(), phase);
		}
	}
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void populateConfigurationICPPhase(grdActionsRow row, ICPPhaseDisplayVo phase)
{
	// Check row
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error = Can not populate null row (in function populateConfigurationICPPhase");
	
	// Check phase
	if (phase == null)
		return;
	
	// Add phase name
	row.setColAction(phase.getNameIsNotNull() ? phase.getName() : "");
	
	// Add phase to row value
	row.setValue(phase);
	
	// Set images
	row.setExpandedImage(form.getImages().ICP.Phase);
	row.setCollapsedImage(form.getImages().ICP.Phase);
	
	// Set row as selectable, read-only
	row.setSelectable(!PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) && "P".equalsIgnoreCase(form.getGlobalContext().ICP.getTypeToSelect()));
	row.setReadOnly(true);
	
	// Set colors
	row.setBackColor(Color.Beige);
	row.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
	
	// KEEP CODE AS ACTIONS MIGHT BE USED IN THE FUTURE
	
	// Test phase actions
	if (phase.getActionsIsNotNull())
	{
		// Sort the actions
		phase.getActions().sort(new ActionComparator());
		
		// Iterate actions
		for (ICPActionLiteVo action : phase.getActions())
		{
			if (action == null)
				continue;
			
			// Add action to phase row
			populateConfigurationICPAction(row.getRows().newRow(), action);
		}
	}
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private boolean hasPhasesNotAdded()
{
	// Get Patient ICP
	PatientICPViewVo patientICP = form.getLocalContext().getCurrentPatientICP();

	// If no patient ICP exits or configuration ICP is not present -> NO
	// Phases to add
	if (patientICP == null || !patientICP.getICPIsNotNull())
		return false;

	// Get Configuration ICP
	ICPConfigurationDisplayVo configurationICP = form.getLocalContext().getConfigurationICP();

	// If no configuration ICP exits or configuration ICP has no stages ->
	// NO Phases to add
	if (configurationICP == null || !configurationICP.getStagesIsNotNull() || PreActiveActiveInactiveStatus.INACTIVE.equals(configurationICP.getStatus()))
		return false;

	// Sort configuration stages
	configurationICP.getStages().sort(new StageComparator());

	// Iterate configuration stages
	for (ICPStageDisplayVo stage : configurationICP.getStages())
	{
		// Check stage status
		if (stage == null || !PreActiveActiveInactiveStatus.ACTIVE.equals(stage.getStatus()) || !stage.getPhasesIsNotNull())
			continue;

		// Sort configuration phases
		stage.getPhases().sort(new PhaseComparator());

		// Iterate configuration phases
		for (ICPPhaseDisplayVo phase : stage.getPhases())
		{
			// Check phase status
			if (phase == null || !PreActiveActiveInactiveStatus.ACTIVE.equals(phase.getStatus()))
				continue;

			if (!findPhaseInPatientICP((ICPPhaseLiteVo) phase, patientICP.getStages()))
				return true;
		}
	}

	return false;
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void populateICPPhases(TreeNode stageNode, ICPPhaseDisplayVoCollection phases, String filterValue)
{
	// Terminate function if phase collection is null
	if (phases == null)
		return;
	
	// Sort phases
	phases.sort(new PhaseComparator());
	
	for (int i = 0; i < phases.size(); i++)
	{
		ICPPhaseDisplayVo phase = phases.get(i);
		
		if (phases == null)
			continue;
		
		// Add phase to stage node
		TreeNode phaseNode = stageNode.getNodes().add(phase, phase.getName());
		phaseNode.setCheckBoxVisible(false);
		phaseNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
		
		// Set node images
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
		phaseNode.setSelectedImage(form.getImages().ICP.Phase);
		
		// Add ICP Actions
		populateICPActions(phaseNode, phase.getActions(), filterValue);
		
		// Check to see if the node has child, else remove it
		if (filterValue == null || phaseNode.getNodes().size() > 0)
		{
			// Expand the node
			phaseNode.setExpanded(true);
		}
		else
		{
			stageNode.getNodes().remove(phaseNode);
		}
	}
	
}