Java Code Examples for ims.ocrr.vo.lookups.SpecimenCollectionMethod

The following are top voted examples for showing how to use ims.ocrr.vo.lookups.SpecimenCollectionMethod. 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
private void refreshRounds()
{
	form.cmbRound().clear();

	if (form.dteRequired().getValue() != null)
	{
		SpecimenCollectionListConfigDetailsVoCollection rounds = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, form.dteRequired().getValue());

		if (rounds != null)
		{
			for (int i = 0; i < rounds.size(); i++)
			{
				form.cmbRound().newRow(rounds.get(i), rounds.get(i).getTime().getText());
			}
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateListTypeTree()
{
	SpecimenCollectionMethodCollection collMethods = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	ims.framework.cn.data.TreeNode[] parentNodes = collMethods.getRootNodes();
	for(int i=0;i<parentNodes.length;i++)
	{
		ims.framework.cn.data.TreeNode parentNode = parentNodes[i];
		TreeNode ctrlNode = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().add(parentNode,  ((SpecimenCollectionMethod)parentNode).getText());
		for(int p=0;p<parentNode.getChildren().length;p++)
		{
			ims.framework.cn.data.TreeNode childNode = parentNode.getChildren()[p];
			ctrlNode.getNodes().add(childNode,  ((SpecimenCollectionMethod)childNode).getText());	
		}
		ctrlNode.setExpanded(true);
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private SpecimenCollectionMethod getTreeTypesCheckBoxSelectedValue()
{
	for (int i = 0; i < form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().size(); i++)
	{
		TreeNode node = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().get(i);
		if (node.isChecked())
			return (SpecimenCollectionMethod) node.getValue();
		for (int p = 0; p < node.getNodes().size(); p++)
		{
			if (node.getNodes().get(p).isChecked())
				return (SpecimenCollectionMethod) node.getNodes().get(p).getValue();
		}
	}

	return null;

}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void dteCollectValueChanged()
{
	Date date = form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().getValue();
	form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().clear();

	if (date == null)
		return;

	if (date.isLessThan(new Date()))
	{
		engine.showMessage("Date cannot be in the past");
		form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().setValue(null);
		return;
	}

	SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
	if (voCollCfg != null)
	{
		for (int i = 0; i < voCollCfg.size(); i++)
			form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText());
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateOtherControls()
{
	SpecimenCollectionMethodCollection collTypes = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	for (int i = 0; i < collTypes.size(); i++)
	{
		if (collTypes.get(i).equals(SpecimenCollectionMethod.OTHER))
		{
			for (int p = 0; p < collTypes.get(i).getChildren().length; p++)
				form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().newRow((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p], ((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p]).getText());

			break;
		}
	}

	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dteCollectOther().setValue(new Date());
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().setValue(SpecimenCollectionMethod.WARDCOLLECTION);
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().btnApplyOther().setEnabled(true);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void enableControls(SpecimenCollectionMethod value)
{
	boolean enableInpatient = value != null && value.equals(SpecimenCollectionMethod.INPATIENT)?true:false; 
	boolean enableOutpatient= value != null && value.equals(SpecimenCollectionMethod.OUTPATIENT)?true:false;
	
	form.lblDate().setVisible(enableInpatient);
	form.dteDate().setVisible(enableInpatient);
	form.lblRound().setVisible(enableInpatient);
	form.cmbRound().setVisible(enableInpatient);
	form.cmbRound().setRequired(enableInpatient);
	
	form.lblQuantity().setVisible(enableOutpatient);
	form.intQuantity().setVisible(enableOutpatient);
	form.intQuantity().setRequired(enableOutpatient);
	form.lblValue().setVisible(enableOutpatient);
	form.cmbValues().setVisible(enableOutpatient);
	form.cmbValues().setRequired(enableOutpatient);
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateControls(SpecimenCollectionMethod value)
{
	if(value != null)
	{
		if (value.equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			OutPatientDurationCollection collDuration = LookupHelper.getOutPatientDuration(domain.getLookupService());
			if (form.cmbValues().getValues().size() == 0)
			{
				for (int i = 0; i < collDuration.size(); i++)
				{
					form.cmbValues().newRow(collDuration.get(i), collDuration.get(i).toString());
				}
			}
		}
		else if (value.equals(SpecimenCollectionMethod.INPATIENT))//WDEV-16964
		{
			form.dteDate().setValue(new Date());
			dateChanged();
		}
		
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void dateChanged()
{
	Date date = form.dteDate().getValue();
	form.cmbRound().clear();

	if (date == null)
		return;

	if (date.isLessThan(new Date()))
	{
		engine.showMessage("Date cannot be in the past");
		form.dteDate().setValue(null);
		return;
	}

	SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
	if (voCollCfg != null)
	{
		for (int i = 0; i < voCollCfg.size(); i++)
			form.cmbRound().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText());
	}
}
 
Example 9
Project: AvoinApotti   File: SpecimenCollectionConfigImpl.java   View source code 6 votes vote down vote up
public SpecimenCollectionListConfigVo getSpecimenCollectionConfig(SpecimenCollectionMethod lookUpId) 
{
	if(lookUpId == null)
		throw new DomainRuntimeException("Id has not been provided for get call. ");
	
	DomainFactory factory = getDomainFactory();
	
	List listSpecCollectionList = factory.find("from SpecimenCollectionListConfig sclc where sclc.listType = :ltype",new String[]{"ltype"},new Object[]{getDomLookup(lookUpId)});		
	if(listSpecCollectionList != null && listSpecCollectionList.size() > 0)
	{ 
		SpecimenCollectionListConfigVoCollection voCollSpecimen = SpecimenCollectionListConfigVoAssembler.createSpecimenCollectionListConfigVoCollectionFromSpecimenCollectionListConfig(listSpecCollectionList);
		if(voCollSpecimen != null && voCollSpecimen.size() > 0)
			return voCollSpecimen.get(0);
	}
	return null;
}
 
Example 10
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void refreshRounds()
{
	form.cmbRound().clear();

	if (form.dteRequired().getValue() != null)
	{
		SpecimenCollectionListConfigDetailsVoCollection rounds = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, form.dteRequired().getValue());

		if (rounds != null)
		{
			for (int i = 0; i < rounds.size(); i++)
			{
				form.cmbRound().newRow(rounds.get(i), rounds.get(i).getTime().getText());
			}
		}
	}
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateListTypeTree()
{
	SpecimenCollectionMethodCollection collMethods = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	ims.framework.cn.data.TreeNode[] parentNodes = collMethods.getRootNodes();
	for(int i=0;i<parentNodes.length;i++)
	{
		ims.framework.cn.data.TreeNode parentNode = parentNodes[i];
		TreeNode ctrlNode = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().add(parentNode,  ((SpecimenCollectionMethod)parentNode).getText());
		for(int p=0;p<parentNode.getChildren().length;p++)
		{
			ims.framework.cn.data.TreeNode childNode = parentNode.getChildren()[p];
			ctrlNode.getNodes().add(childNode,  ((SpecimenCollectionMethod)childNode).getText());	
		}
		ctrlNode.setExpanded(true);
	}
}
 
Example 12
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private SpecimenCollectionMethod getTreeTypesCheckBoxSelectedValue()
{
	for (int i = 0; i < form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().size(); i++)
	{
		TreeNode node = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().get(i);
		if (node.isChecked())
			return (SpecimenCollectionMethod) node.getValue();
		for (int p = 0; p < node.getNodes().size(); p++)
		{
			if (node.getNodes().get(p).isChecked())
				return (SpecimenCollectionMethod) node.getNodes().get(p).getValue();
		}
	}

	return null;

}
 
Example 13
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void dteCollectValueChanged()
{
	Date date = form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().getValue();
	form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().clear();

	if (date == null)
		return;

	if (date.isLessThan(new Date()))
	{
		engine.showMessage("Date cannot be in the past");
		form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().setValue(null);
		return;
	}

	SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
	if (voCollCfg != null)
	{
		for (int i = 0; i < voCollCfg.size(); i++)
			form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText());
	}
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateOtherControls()
{
	SpecimenCollectionMethodCollection collTypes = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	for (int i = 0; i < collTypes.size(); i++)
	{
		if (collTypes.get(i).equals(SpecimenCollectionMethod.OTHER))
		{
			for (int p = 0; p < collTypes.get(i).getChildren().length; p++)
				form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().newRow((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p], ((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p]).getText());

			break;
		}
	}

	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dteCollectOther().setValue(new Date());
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().setValue(SpecimenCollectionMethod.WARDCOLLECTION);
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().btnApplyOther().setEnabled(true);
}
 
Example 15
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void enableControls(SpecimenCollectionMethod value)
{
	boolean enableInpatient = value != null && value.equals(SpecimenCollectionMethod.INPATIENT)?true:false; 
	boolean enableOutpatient= value != null && value.equals(SpecimenCollectionMethod.OUTPATIENT)?true:false;
	
	form.lblDate().setVisible(enableInpatient);
	form.dteDate().setVisible(enableInpatient);
	form.lblRound().setVisible(enableInpatient);
	form.cmbRound().setVisible(enableInpatient);
	form.cmbRound().setRequired(enableInpatient);
	
	form.lblQuantity().setVisible(enableOutpatient);
	form.intQuantity().setVisible(enableOutpatient);
	form.intQuantity().setRequired(enableOutpatient);
	form.lblValue().setVisible(enableOutpatient);
	form.cmbValues().setVisible(enableOutpatient);
	form.cmbValues().setRequired(enableOutpatient);
}
 
Example 16
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateControls(SpecimenCollectionMethod value)
{
	if(value != null)
	{
		if (value.equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			OutPatientDurationCollection collDuration = LookupHelper.getOutPatientDuration(domain.getLookupService());
			if (form.cmbValues().getValues().size() == 0)
			{
				for (int i = 0; i < collDuration.size(); i++)
				{
					form.cmbValues().newRow(collDuration.get(i), collDuration.get(i).toString());
				}
			}
		}
		else if (value.equals(SpecimenCollectionMethod.INPATIENT))//WDEV-16964
		{
			form.dteDate().setValue(new Date());
			dateChanged();
		}
		
	}
}
 
Example 17
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void dateChanged()
{
	Date date = form.dteDate().getValue();
	form.cmbRound().clear();

	if (date == null)
		return;

	if (date.isLessThan(new Date()))
	{
		engine.showMessage("Date cannot be in the past");
		form.dteDate().setValue(null);
		return;
	}

	SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
	if (voCollCfg != null)
	{
		for (int i = 0; i < voCollCfg.size(); i++)
			form.cmbRound().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText());
	}
}
 
Example 18
Project: openMAXIMS   File: SpecimenCollectionConfigImpl.java   View source code 6 votes vote down vote up
public SpecimenCollectionListConfigVo getSpecimenCollectionConfig(SpecimenCollectionMethod lookUpId) 
{
	if(lookUpId == null)
		throw new DomainRuntimeException("Id has not been provided for get call. ");
	
	DomainFactory factory = getDomainFactory();
	
	List listSpecCollectionList = factory.find("from SpecimenCollectionListConfig sclc where sclc.listType = :ltype",new String[]{"ltype"},new Object[]{getDomLookup(lookUpId)});		
	if(listSpecCollectionList != null && listSpecCollectionList.size() > 0)
	{ 
		SpecimenCollectionListConfigVoCollection voCollSpecimen = SpecimenCollectionListConfigVoAssembler.createSpecimenCollectionListConfigVoCollectionFromSpecimenCollectionListConfig(listSpecCollectionList);
		if(voCollSpecimen != null && voCollSpecimen.size() > 0)
			return voCollSpecimen.get(0);
	}
	return null;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void refreshRounds()
{
	form.cmbRound().clear();

	if (form.dteRequired().getValue() != null)
	{
		SpecimenCollectionListConfigDetailsVoCollection rounds = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, form.dteRequired().getValue());

		if (rounds != null)
		{
			for (int i = 0; i < rounds.size(); i++)
			{
				form.cmbRound().newRow(rounds.get(i), rounds.get(i).getTime().getText());
			}
		}
	}
}
 
Example 20
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateListTypeTree()
{
	SpecimenCollectionMethodCollection collMethods = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	ims.framework.cn.data.TreeNode[] parentNodes = collMethods.getRootNodes();
	for(int i=0;i<parentNodes.length;i++)
	{
		ims.framework.cn.data.TreeNode parentNode = parentNodes[i];
		TreeNode ctrlNode = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().add(parentNode,  ((SpecimenCollectionMethod)parentNode).getText());
		for(int p=0;p<parentNode.getChildren().length;p++)
		{
			ims.framework.cn.data.TreeNode childNode = parentNode.getChildren()[p];
			ctrlNode.getNodes().add(childNode,  ((SpecimenCollectionMethod)childNode).getText());	
		}
		ctrlNode.setExpanded(true);
	}
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private SpecimenCollectionMethod getTreeTypesCheckBoxSelectedValue()
{
	for (int i = 0; i < form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().size(); i++)
	{
		TreeNode node = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().get(i);
		if (node.isChecked())
			return (SpecimenCollectionMethod) node.getValue();
		for (int p = 0; p < node.getNodes().size(); p++)
		{
			if (node.getNodes().get(p).isChecked())
				return (SpecimenCollectionMethod) node.getNodes().get(p).getValue();
		}
	}

	return null;

}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void dteCollectValueChanged()
{
	Date date = form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().getValue();
	form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().clear();

	if (date == null)
		return;

	if (date.isLessThan(new Date()))
	{
		engine.showMessage("Date cannot be in the past");
		form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().setValue(null);
		return;
	}

	SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
	if (voCollCfg != null)
	{
		for (int i = 0; i < voCollCfg.size(); i++)
			form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText());
	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateOtherControls()
{
	SpecimenCollectionMethodCollection collTypes = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	for (int i = 0; i < collTypes.size(); i++)
	{
		if (collTypes.get(i).equals(SpecimenCollectionMethod.OTHER))
		{
			for (int p = 0; p < collTypes.get(i).getChildren().length; p++)
				form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().newRow((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p], ((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p]).getText());

			break;
		}
	}

	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dteCollectOther().setValue(new Date());
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().setValue(SpecimenCollectionMethod.WARDCOLLECTION);
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().btnApplyOther().setEnabled(true);
}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void enableControls(SpecimenCollectionMethod value)
{
	boolean enableInpatient = value != null && value.equals(SpecimenCollectionMethod.INPATIENT)?true:false; 
	boolean enableOutpatient= value != null && value.equals(SpecimenCollectionMethod.OUTPATIENT)?true:false;
	
	form.lblDate().setVisible(enableInpatient);
	form.dteDate().setVisible(enableInpatient);
	form.lblRound().setVisible(enableInpatient);
	form.cmbRound().setVisible(enableInpatient);
	form.cmbRound().setRequired(enableInpatient);
	
	form.lblQuantity().setVisible(enableOutpatient);
	form.intQuantity().setVisible(enableOutpatient);
	form.intQuantity().setRequired(enableOutpatient);
	form.lblValue().setVisible(enableOutpatient);
	form.cmbValues().setVisible(enableOutpatient);
	form.cmbValues().setRequired(enableOutpatient);
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateControls(SpecimenCollectionMethod value)
{
	if(value != null)
	{
		if (value.equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			OutPatientDurationCollection collDuration = LookupHelper.getOutPatientDuration(domain.getLookupService());
			if (form.cmbValues().getValues().size() == 0)
			{
				for (int i = 0; i < collDuration.size(); i++)
				{
					form.cmbValues().newRow(collDuration.get(i), collDuration.get(i).toString());
				}
			}
		}
		else if (value.equals(SpecimenCollectionMethod.INPATIENT))//WDEV-16964
		{
			form.dteDate().setValue(new Date());
			dateChanged();
		}
		
	}
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void dateChanged()
{
	Date date = form.dteDate().getValue();
	form.cmbRound().clear();

	if (date == null)
		return;

	if (date.isLessThan(new Date()))
	{
		engine.showMessage("Date cannot be in the past");
		form.dteDate().setValue(null);
		return;
	}

	SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
	if (voCollCfg != null)
	{
		for (int i = 0; i < voCollCfg.size(); i++)
			form.cmbRound().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText());
	}
}
 
Example 27
Project: openMAXIMS   File: SpecimenCollectionConfigImpl.java   View source code 6 votes vote down vote up
public SpecimenCollectionListConfigVo getSpecimenCollectionConfig(SpecimenCollectionMethod lookUpId) 
{
	if(lookUpId == null)
		throw new DomainRuntimeException("Id has not been provided for get call. ");
	
	DomainFactory factory = getDomainFactory();
	
	List listSpecCollectionList = factory.find("from SpecimenCollectionListConfig sclc where sclc.listType = :ltype",new String[]{"ltype"},new Object[]{getDomLookup(lookUpId)});		
	if(listSpecCollectionList != null && listSpecCollectionList.size() > 0)
	{ 
		SpecimenCollectionListConfigVoCollection voCollSpecimen = SpecimenCollectionListConfigVoAssembler.createSpecimenCollectionListConfigVoCollectionFromSpecimenCollectionListConfig(listSpecCollectionList);
		if(voCollSpecimen != null && voCollSpecimen.size() > 0)
			return voCollSpecimen.get(0);
	}
	return null;
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void refreshRounds()
{
	form.cmbRound().clear();

	if (form.dteRequired().getValue() != null)
	{
		SpecimenCollectionListConfigDetailsVoCollection rounds = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, form.dteRequired().getValue());

		if (rounds != null)
		{
			for (int i = 0; i < rounds.size(); i++)
			{
				form.cmbRound().newRow(rounds.get(i), rounds.get(i).getTime().getText());
			}
		}
	}
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateListTypeTree()
{
	SpecimenCollectionMethodCollection collMethods = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	ims.framework.cn.data.TreeNode[] parentNodes = collMethods.getRootNodes();
	for(int i=0;i<parentNodes.length;i++)
	{
		ims.framework.cn.data.TreeNode parentNode = parentNodes[i];
		TreeNode ctrlNode = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().add(parentNode,  ((SpecimenCollectionMethod)parentNode).getText());
		for(int p=0;p<parentNode.getChildren().length;p++)
		{
			ims.framework.cn.data.TreeNode childNode = parentNode.getChildren()[p];
			ctrlNode.getNodes().add(childNode,  ((SpecimenCollectionMethod)childNode).getText());	
		}
		ctrlNode.setExpanded(true);
	}
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private SpecimenCollectionMethod getTreeTypesCheckBoxSelectedValue()
{
	for (int i = 0; i < form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().size(); i++)
	{
		TreeNode node = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().get(i);
		if (node.isChecked())
			return (SpecimenCollectionMethod) node.getValue();
		for (int p = 0; p < node.getNodes().size(); p++)
		{
			if (node.getNodes().get(p).isChecked())
				return (SpecimenCollectionMethod) node.getNodes().get(p).getValue();
		}
	}

	return null;

}
 
Example 31
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void dteCollectValueChanged()
{
	Date date = form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().getValue();
	form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().clear();

	if (date == null)
		return;

	if (date.isLessThan(new Date()))
	{
		engine.showMessage("Date cannot be in the past");
		form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dteCollect().setValue(null);
		return;
	}

	SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
	if (voCollCfg != null)
	{
		for (int i = 0; i < voCollCfg.size(); i++)
			form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().cmbTime().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText());
	}
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateOtherControls()
{
	SpecimenCollectionMethodCollection collTypes = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	for (int i = 0; i < collTypes.size(); i++)
	{
		if (collTypes.get(i).equals(SpecimenCollectionMethod.OTHER))
		{
			for (int p = 0; p < collTypes.get(i).getChildren().length; p++)
				form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().newRow((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p], ((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p]).getText());

			break;
		}
	}

	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dteCollectOther().setValue(new Date());
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().setValue(SpecimenCollectionMethod.WARDCOLLECTION);
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().btnApplyOther().setEnabled(true);
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void enableControls(SpecimenCollectionMethod value)
{
	boolean enableInpatient = value != null && value.equals(SpecimenCollectionMethod.INPATIENT)?true:false; 
	boolean enableOutpatient= value != null && value.equals(SpecimenCollectionMethod.OUTPATIENT)?true:false;
	
	form.lblDate().setVisible(enableInpatient);
	form.dteDate().setVisible(enableInpatient);
	form.lblRound().setVisible(enableInpatient);
	form.cmbRound().setVisible(enableInpatient);
	form.cmbRound().setRequired(enableInpatient);
	
	form.lblQuantity().setVisible(enableOutpatient);
	form.intQuantity().setVisible(enableOutpatient);
	form.intQuantity().setRequired(enableOutpatient);
	form.lblValue().setVisible(enableOutpatient);
	form.cmbValues().setVisible(enableOutpatient);
	form.cmbValues().setRequired(enableOutpatient);
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void populateControls(SpecimenCollectionMethod value)
{
	if(value != null)
	{
		if (value.equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			OutPatientDurationCollection collDuration = LookupHelper.getOutPatientDuration(domain.getLookupService());
			if (form.cmbValues().getValues().size() == 0)
			{
				for (int i = 0; i < collDuration.size(); i++)
				{
					form.cmbValues().newRow(collDuration.get(i), collDuration.get(i).toString());
				}
			}
		}
		else if (value.equals(SpecimenCollectionMethod.INPATIENT))//WDEV-16964
		{
			form.dteDate().setValue(new Date());
			dateChanged();
		}
		
	}
}
 
Example 35
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void dateChanged()
{
	Date date = form.dteDate().getValue();
	form.cmbRound().clear();

	if (date == null)
		return;

	if (date.isLessThan(new Date()))
	{
		engine.showMessage("Date cannot be in the past");
		form.dteDate().setValue(null);
		return;
	}

	SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
	if (voCollCfg != null)
	{
		for (int i = 0; i < voCollCfg.size(); i++)
			form.cmbRound().newRow(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().getText());
	}
}
 
Example 36
Project: openmaxims-linux   File: SpecimenCollectionConfigImpl.java   View source code 6 votes vote down vote up
public SpecimenCollectionListConfigVo getSpecimenCollectionConfig(SpecimenCollectionMethod lookUpId) 
{
	if(lookUpId == null)
		throw new DomainRuntimeException("Id has not been provided for get call. ");
	
	DomainFactory factory = getDomainFactory();
	
	List listSpecCollectionList = factory.find("from SpecimenCollectionListConfig sclc where sclc.listType = :ltype",new String[]{"ltype"},new Object[]{getDomLookup(lookUpId)});		
	if(listSpecCollectionList != null && listSpecCollectionList.size() > 0)
	{ 
		SpecimenCollectionListConfigVoCollection voCollSpecimen = SpecimenCollectionListConfigVoAssembler.createSpecimenCollectionListConfigVoCollectionFromSpecimenCollectionListConfig(listSpecCollectionList);
		if(voCollSpecimen != null && voCollSpecimen.size() > 0)
			return voCollSpecimen.get(0);
	}
	return null;
}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onBtnApplyOtherClick() throws PresentationLogicException
{
	SpecimenCollectionMethod type = form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().getValue();
	Date date = form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dteCollectOther().getValue();
	Time time = form.lyrDetails().tabPathDetails().lyrPathology().tabOther().timCollectOther().getValue();

	applyDefaultsToOtherGrid(type, date, time);
}
 
Example 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onDyngrdPhlebCellValueChanged(DynamicGridCell cell)
{
	DynamicGrid grid = form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdInpat();

	if (cell.getType().equals(DynamicCellType.DATE))
	{
		Date date = (Date) cell.getValue();

		DynamicGridCell cellTimes = cell.getRow().getCells().get(grid.getColumns().getByIdentifier(DYN_COLTIME));
		cellTimes.getItems().clear();
		
		if (date != null)
		{
			if (date.isLessThan(new Date()))
			{
				engine.showMessage("Date cannot be in the past");
				cell.setValue(null);
				return;
			}

			SpecimenCollectionListConfigDetailsVoCollection voCollCfg = domain.listSpecimenCollectionDetails(SpecimenCollectionMethod.INPATIENT, date);
			if (voCollCfg != null)
			{
				for (int i = 0; i < voCollCfg.size(); i++)
					cellTimes.getItems().newItem(voCollCfg.get(i).getTime(), voCollCfg.get(i).getTime().toString());
			}
		}
	}
}
 
Example 39
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void bindCellToLookup(DynamicGridCell cell, DynamicGrid grid)
{
	if (cell == null || grid == null)
		throw new CodingRuntimeException("Coding Error - cell or grid is null (bindCellToLookup)");

	if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdOutPat()))
	{
		cell.getItems().newItem(SpecimenCollectionMethod.INPATIENT, SpecimenCollectionMethod.INPATIENT.getText());
		cell.getItems().newItem(SpecimenCollectionMethod.OUTPATIENT, SpecimenCollectionMethod.OUTPATIENT.getText());
	}
	else if (grid.equals(form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dyngrdOther()))
	{
		SpecimenCollectionMethodCollection collMethods = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
		for (int i = 0; i < collMethods.size(); i++)
		{
			if (collMethods.get(i).equals(SpecimenCollectionMethod.OTHER))
			{
				for (int p = 0; p < collMethods.get(i).getChildren().length; p++)
					cell.getItems().newItem(collMethods.get(i).getChildren()[p], (collMethods.get(i).getChildren()[p]).toString());

				break;
			}

		}
	}
	cell.setIdentifier(SpecimenCollectionMethod.class);
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void applyDefaultsToPhlebGrid(SpecimenCollectionSettings settings)
{
	if (settings == null)
		throw new CodingRuntimeException("settings parameter in applyToPhlebGrid method is null");

	// go through phleb grid setting defaults according to settings
	DynamicGrid dynGridPhleb = settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.INPATIENT) ? form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdInpat() : form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdOutPat();

	for (int i = 0; i < dynGridPhleb.getRows().size(); i++)
	{
		if (settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.INPATIENT))
		{
			DynamicGridColumn colDate = dynGridPhleb.getColumns().getByIdentifier(DYN_COLDATE);
			DynamicGridColumn colTime = dynGridPhleb.getColumns().getByIdentifier(DYN_COLTIME);

			for (int p = 0; p < dynGridPhleb.getRows().get(i).getRows().size(); p++)
			{
				refreshGridDataForCollectionInfoInpatient(dynGridPhleb.getRows().get(i).getRows().get(p), colDate, colTime, settings);
				dynGridPhleb.getRows().get(i).getRows().get(p).getCells().get(dynGridPhleb.getColumns().getByIdentifier(QTY_COLUMN)).setWidth(80);
			}
		}
		else if (settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			DynamicGridColumn colAt = dynGridPhleb.getColumns().getByIdentifier(DYN_COLAT);
			DynamicGridColumn colDuration = dynGridPhleb.getColumns().getByIdentifier(DYN_COLDURATION);

			for (int p = 0; p < dynGridPhleb.getRows().get(i).getRows().size(); p++)
			{
				refreshGridDataForCollectionInfoOutpatient(dynGridPhleb.getRows().get(i).getRows().get(p), colAt, colDuration, settings);
				dynGridPhleb.getRows().get(i).getRows().get(p).getCells().get(dynGridPhleb.getColumns().getByIdentifier(QTY_COLUMN)).setWidth(80);
			}
		}
	}
}