Java Code Examples for ims.ocrr.vo.SpecimenWorkListItemListVo.setSpecimen()

The following are Jave code examples for showing how to use setSpecimen() of the ims.ocrr.vo.SpecimenWorkListItemListVo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AvoinApotti   File: WardSpecimenMoveToImpl.java   View Source Code Vote up 5 votes
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo specimenWorkListItem, SpecimenWorkListItemListVo prevSpecimenWorkListItem) throws StaleObjectException
{
	if(specimenWorkListItem == null || prevSpecimenWorkListItem == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	if(specimenWorkListItem.isValidated() == false)
	{
		throw new RuntimeException("Current SpecimenWorkListItemListVo is not validated");
	}
	if(prevSpecimenWorkListItem.isValidated() == false)
	{
		throw new RuntimeException("Parent SpecimenWorkListItemListVo is not validated");
	}
			
	DomainFactory factory = getDomainFactory();

	//Save previous specimen
	SpecimenWorkListItem doPrevSpecimen = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, prevSpecimenWorkListItem);
	factory.save(doPrevSpecimen);
	SpecimenWorkListItemListVo voPrevSpecimen = SpecimenWorkListItemListVoAssembler.create(doPrevSpecimen);

	//Avoid stale object Exception by setting again the specimen and setting the comment from the old vo
	OrderSpecimenListVo newSpecimen = voPrevSpecimen.getSpecimen();
	specimenWorkListItem.getSpecimen().setCollectorComment(newSpecimen.getCollectorComment());
	specimenWorkListItem.setSpecimen(newSpecimen);
	//Save the newly created specimen
	SpecimenWorkListItem doSpecimen = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, specimenWorkListItem);
	factory.save(doSpecimen);

	return voPrevSpecimen;
}
 
Example 2
Project: openMAXIMS   File: WardSpecimenMoveToImpl.java   View Source Code Vote up 5 votes
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo specimenWorkListItem, SpecimenWorkListItemListVo prevSpecimenWorkListItem) throws StaleObjectException
{
	if(specimenWorkListItem == null || prevSpecimenWorkListItem == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	if(specimenWorkListItem.isValidated() == false)
	{
		throw new RuntimeException("Current SpecimenWorkListItemListVo is not validated");
	}
	if(prevSpecimenWorkListItem.isValidated() == false)
	{
		throw new RuntimeException("Parent SpecimenWorkListItemListVo is not validated");
	}
			
	DomainFactory factory = getDomainFactory();

	//Save previous specimen
	SpecimenWorkListItem doPrevSpecimen = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, prevSpecimenWorkListItem);
	factory.save(doPrevSpecimen);
	SpecimenWorkListItemListVo voPrevSpecimen = SpecimenWorkListItemListVoAssembler.create(doPrevSpecimen);

	//Avoid stale object Exception by setting again the specimen and setting the comment from the old vo
	OrderSpecimenListVo newSpecimen = voPrevSpecimen.getSpecimen();
	specimenWorkListItem.getSpecimen().setCollectorComment(newSpecimen.getCollectorComment());
	specimenWorkListItem.setSpecimen(newSpecimen);
	//Save the newly created specimen
	SpecimenWorkListItem doSpecimen = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, specimenWorkListItem);
	factory.save(doSpecimen);

	return voPrevSpecimen;
}
 
Example 3
Project: openMAXIMS   File: WardSpecimenMoveToImpl.java   View Source Code Vote up 5 votes
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo specimenWorkListItem, SpecimenWorkListItemListVo prevSpecimenWorkListItem) throws StaleObjectException
{
	if(specimenWorkListItem == null || prevSpecimenWorkListItem == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	if(specimenWorkListItem.isValidated() == false)
	{
		throw new RuntimeException("Current SpecimenWorkListItemListVo is not validated");
	}
	if(prevSpecimenWorkListItem.isValidated() == false)
	{
		throw new RuntimeException("Parent SpecimenWorkListItemListVo is not validated");
	}
			
	DomainFactory factory = getDomainFactory();

	//Save previous specimen
	SpecimenWorkListItem doPrevSpecimen = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, prevSpecimenWorkListItem);
	factory.save(doPrevSpecimen);
	SpecimenWorkListItemListVo voPrevSpecimen = SpecimenWorkListItemListVoAssembler.create(doPrevSpecimen);

	//Avoid stale object Exception by setting again the specimen and setting the comment from the old vo
	OrderSpecimenListVo newSpecimen = voPrevSpecimen.getSpecimen();
	specimenWorkListItem.getSpecimen().setCollectorComment(newSpecimen.getCollectorComment());
	specimenWorkListItem.setSpecimen(newSpecimen);
	//Save the newly created specimen
	SpecimenWorkListItem doSpecimen = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, specimenWorkListItem);
	factory.save(doSpecimen);

	return voPrevSpecimen;
}
 
Example 4
Project: openmaxims-linux   File: WardSpecimenMoveToImpl.java   View Source Code Vote up 5 votes
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo specimenWorkListItem, SpecimenWorkListItemListVo prevSpecimenWorkListItem) throws StaleObjectException
{
	if(specimenWorkListItem == null || prevSpecimenWorkListItem == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	if(specimenWorkListItem.isValidated() == false)
	{
		throw new RuntimeException("Current SpecimenWorkListItemListVo is not validated");
	}
	if(prevSpecimenWorkListItem.isValidated() == false)
	{
		throw new RuntimeException("Parent SpecimenWorkListItemListVo is not validated");
	}
			
	DomainFactory factory = getDomainFactory();

	//Save previous specimen
	SpecimenWorkListItem doPrevSpecimen = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, prevSpecimenWorkListItem);
	factory.save(doPrevSpecimen);
	SpecimenWorkListItemListVo voPrevSpecimen = SpecimenWorkListItemListVoAssembler.create(doPrevSpecimen);

	//Avoid stale object Exception by setting again the specimen and setting the comment from the old vo
	OrderSpecimenListVo newSpecimen = voPrevSpecimen.getSpecimen();
	specimenWorkListItem.getSpecimen().setCollectorComment(newSpecimen.getCollectorComment());
	specimenWorkListItem.setSpecimen(newSpecimen);
	//Save the newly created specimen
	SpecimenWorkListItem doSpecimen = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, specimenWorkListItem);
	factory.save(doSpecimen);

	return voPrevSpecimen;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private boolean saveWorkListItem()
{
	SpecimenCollectionMethod  colMethod = form.cmbCollection().getValue();
	if(colMethod != null)
	{
		//WDEV-16747
		if (! validateUiRules())
			return false;
		
		//Patient Assessment
		//WDEV-2990 
		SpecimenWorkListItemListVo previousWorkListItemVo = (SpecimenWorkListItemListVo)form.getGlobalContext().OCRR.getSpecimenWorkListItemList().clone();
		previousWorkListItemVo.setCollectionStatus(SpecimenCollectionStatus.MOVEDTOPHLEBOTOMY);
		
		//Newly created Patient Assessment
		SpecimenWorkListItemListVo voItem = new SpecimenWorkListItemListVo();
		//Common info
		voItem.setSpecimen(previousWorkListItemVo.getSpecimen());
		//Update the comment - !!! Any change to the Specimen should be done also in the impl!!!!
		String commentCollected = "Moved to Phlebotomy";
		commentCollected = getPhlebotomistComment(voItem.getSpecimen().getCollectorComment(), engine.getLoggedInUser().getUserRealName(), new DateTime(), commentCollected);
		voItem.getSpecimen().setCollectorComment(commentCollected);
		//------------------
		voItem.setListType(colMethod);
		voItem.setCollectionStatus(SpecimenCollectionStatus.FORCOLLECTION);
		
		if(colMethod.equals(SpecimenCollectionMethod.INPATIENT))
		{
			voItem.setDateToCollect(form.dteDate().getValue());
			voItem.setRoundToCollect(form.cmbRound().getValue());
			updateRequiredByDateField(previousWorkListItemVo, form.dteDate().getValue());//WDEV-16898
			
			return saveVos(voItem, previousWorkListItemVo);
		}
		else if(colMethod.equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			Date outpatientDate = calculateOutpatientDate();
			voItem.setDateToCollect(outpatientDate);
			updateRequiredByDateField(previousWorkListItemVo, outpatientDate);//WDEV-16898
			
			return saveVos(voItem, previousWorkListItemVo);
		}
	}
	else
	{
		engine.showMessage("Please select a Collection");
		form.cmbCollection().setFocus();
		return false;
	}
	
	return true;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private boolean saveWorkListItem()
{
	SpecimenCollectionMethod  colMethod = form.cmbCollection().getValue();
	if(colMethod != null)
	{
		//WDEV-16747
		if (! validateUiRules())
			return false;
		
		//Patient Assessment
		//WDEV-2990 
		SpecimenWorkListItemListVo previousWorkListItemVo = (SpecimenWorkListItemListVo)form.getGlobalContext().OCRR.getSpecimenWorkListItemList().clone();
		previousWorkListItemVo.setCollectionStatus(SpecimenCollectionStatus.MOVEDTOPHLEBOTOMY);
		
		//Newly created Patient Assessment
		SpecimenWorkListItemListVo voItem = new SpecimenWorkListItemListVo();
		//Common info
		voItem.setSpecimen(previousWorkListItemVo.getSpecimen());
		//Update the comment - !!! Any change to the Specimen should be done also in the impl!!!!
		String commentCollected = "Moved to Phlebotomy";
		commentCollected = getPhlebotomistComment(voItem.getSpecimen().getCollectorComment(), engine.getLoggedInUser().getUserRealName(), new DateTime(), commentCollected);
		voItem.getSpecimen().setCollectorComment(commentCollected);
		//------------------
		voItem.setListType(colMethod);
		voItem.setCollectionStatus(SpecimenCollectionStatus.FORCOLLECTION);
		
		if(colMethod.equals(SpecimenCollectionMethod.INPATIENT))
		{
			voItem.setDateToCollect(form.dteDate().getValue());
			voItem.setRoundToCollect(form.cmbRound().getValue());
			updateRequiredByDateField(previousWorkListItemVo, form.dteDate().getValue());//WDEV-16898
			
			return saveVos(voItem, previousWorkListItemVo);
		}
		else if(colMethod.equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			Date outpatientDate = calculateOutpatientDate();
			voItem.setDateToCollect(outpatientDate);
			updateRequiredByDateField(previousWorkListItemVo, outpatientDate);//WDEV-16898
			
			return saveVos(voItem, previousWorkListItemVo);
		}
	}
	else
	{
		engine.showMessage("Please select a Collection");
		form.cmbCollection().setFocus();
		return false;
	}
	
	return true;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private boolean saveWorkListItem()
{
	SpecimenCollectionMethod  colMethod = form.cmbCollection().getValue();
	if(colMethod != null)
	{
		//WDEV-16747
		if (! validateUiRules())
			return false;
		
		//Patient Assessment
		//WDEV-2990 
		SpecimenWorkListItemListVo previousWorkListItemVo = (SpecimenWorkListItemListVo)form.getGlobalContext().OCRR.getSpecimenWorkListItemList().clone();
		previousWorkListItemVo.setCollectionStatus(SpecimenCollectionStatus.MOVEDTOPHLEBOTOMY);
		
		//Newly created Patient Assessment
		SpecimenWorkListItemListVo voItem = new SpecimenWorkListItemListVo();
		//Common info
		voItem.setSpecimen(previousWorkListItemVo.getSpecimen());
		//Update the comment - !!! Any change to the Specimen should be done also in the impl!!!!
		String commentCollected = "Moved to Phlebotomy";
		commentCollected = getPhlebotomistComment(voItem.getSpecimen().getCollectorComment(), engine.getLoggedInUser().getUserRealName(), new DateTime(), commentCollected);
		voItem.getSpecimen().setCollectorComment(commentCollected);
		//------------------
		voItem.setListType(colMethod);
		voItem.setCollectionStatus(SpecimenCollectionStatus.FORCOLLECTION);
		
		if(colMethod.equals(SpecimenCollectionMethod.INPATIENT))
		{
			voItem.setDateToCollect(form.dteDate().getValue());
			voItem.setRoundToCollect(form.cmbRound().getValue());
			updateRequiredByDateField(previousWorkListItemVo, form.dteDate().getValue());//WDEV-16898
			
			return saveVos(voItem, previousWorkListItemVo);
		}
		else if(colMethod.equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			Date outpatientDate = calculateOutpatientDate();
			voItem.setDateToCollect(outpatientDate);
			updateRequiredByDateField(previousWorkListItemVo, outpatientDate);//WDEV-16898
			
			return saveVos(voItem, previousWorkListItemVo);
		}
	}
	else
	{
		engine.showMessage("Please select a Collection");
		form.cmbCollection().setFocus();
		return false;
	}
	
	return true;
}
 
Example 8
Project: openmaxims-linux   File: Logic.java   View Source Code Vote up 4 votes
private boolean saveWorkListItem()
{
	SpecimenCollectionMethod  colMethod = form.cmbCollection().getValue();
	if(colMethod != null)
	{
		//WDEV-16747
		if (! validateUiRules())
			return false;
		
		//Patient Assessment
		//WDEV-2990 
		SpecimenWorkListItemListVo previousWorkListItemVo = (SpecimenWorkListItemListVo)form.getGlobalContext().OCRR.getSpecimenWorkListItemList().clone();
		previousWorkListItemVo.setCollectionStatus(SpecimenCollectionStatus.MOVEDTOPHLEBOTOMY);
		
		//Newly created Patient Assessment
		SpecimenWorkListItemListVo voItem = new SpecimenWorkListItemListVo();
		//Common info
		voItem.setSpecimen(previousWorkListItemVo.getSpecimen());
		//Update the comment - !!! Any change to the Specimen should be done also in the impl!!!!
		String commentCollected = "Moved to Phlebotomy";
		commentCollected = getPhlebotomistComment(voItem.getSpecimen().getCollectorComment(), engine.getLoggedInUser().getUserRealName(), new DateTime(), commentCollected);
		voItem.getSpecimen().setCollectorComment(commentCollected);
		//------------------
		voItem.setListType(colMethod);
		voItem.setCollectionStatus(SpecimenCollectionStatus.FORCOLLECTION);
		
		if(colMethod.equals(SpecimenCollectionMethod.INPATIENT))
		{
			voItem.setDateToCollect(form.dteDate().getValue());
			voItem.setRoundToCollect(form.cmbRound().getValue());
			updateRequiredByDateField(previousWorkListItemVo, form.dteDate().getValue());//WDEV-16898
			
			return saveVos(voItem, previousWorkListItemVo);
		}
		else if(colMethod.equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			Date outpatientDate = calculateOutpatientDate();
			voItem.setDateToCollect(outpatientDate);
			updateRequiredByDateField(previousWorkListItemVo, outpatientDate);//WDEV-16898
			
			return saveVos(voItem, previousWorkListItemVo);
		}
	}
	else
	{
		engine.showMessage("Please select a Collection");
		form.cmbCollection().setFocus();
		return false;
	}
	
	return true;
}