Java Code Examples for ims.ocrr.orderingresults.domain.objects.SpecimenWorkListItem

The following are top voted examples for showing how to use ims.ocrr.orderingresults.domain.objects.SpecimenWorkListItem. 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: MyOrderImpl.java   View source code 6 votes vote down vote up
private SpecimenWorkListItemVoCollection saveWorkListItems(DomainFactory factory, SpecimenWorkListItemVoCollection workListitems, HashMap objMap, ORDERSTATE state) throws StaleObjectException
{
	if (workListitems == null)
		throw new CodingRuntimeException("No workListitems to save - method saveWorkListItems()");

	List items = SpecimenWorkListItemVoAssembler.extractSpecimenWorkListItemList(factory, workListitems, null, objMap);
	Iterator it = items.iterator();

	while (it.hasNext())
	{
		SpecimenWorkListItem item = (SpecimenWorkListItem) it.next();
		if(state.equals(ORDERSTATE.REQUESTING_AUTHORISATION))
			item.setCollectionStatus(getDomLookup(ims.ocrr.vo.lookups.SpecimenCollectionStatus.AWAITING_AUTHORISATION));

		factory.save(item);
	}

	workListitems = SpecimenWorkListItemVoAssembler.createSpecimenWorkListItemVoCollectionFromSpecimenWorkListItem(items);
	return workListitems;
}
 
Example 2
Project: AvoinApotti   File: SpecimenCollectionClinicImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if(orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);
	
	if(orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE) && doSpecimenWorkListItem.getSpecimen() != null)
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 3
Project: AvoinApotti   File: WardSpecimenCollectionImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if (orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();

	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);

	if(doSpecimenWorkListItem.getSpecimen()!=null && orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 4
Project: AvoinApotti   File: BookSpecimenAppointmentDialogImpl.java   View source code 6 votes vote down vote up
public void saveWorkListItems(SpecimenWorkListItemLiteVoCollection workListItems) throws StaleObjectException
{
	if(workListItems == null)
		throw new CodingRuntimeException("workListItems is null in method saveWorkListItems");
	
	DomainFactory factory = getDomainFactory();
	
	List doWorkListItems = SpecimenWorkListItemLiteVoAssembler.extractSpecimenWorkListItemList(factory, workListItems);
	if(doWorkListItems != null && doWorkListItems.size() > 0)
	{
		Iterator it = doWorkListItems.iterator();
		while(it.hasNext())
		{
			SpecimenWorkListItem doWorkListItem =   (SpecimenWorkListItem)it.next();
			factory.save(doWorkListItem);
		}
	}
}
 
Example 5
Project: openMAXIMS   File: MyOrderImpl.java   View source code 6 votes vote down vote up
private SpecimenWorkListItemVoCollection saveWorkListItems(DomainFactory factory, SpecimenWorkListItemVoCollection workListitems, HashMap objMap, ORDERSTATE state) throws StaleObjectException
{
	if (workListitems == null)
		throw new CodingRuntimeException("No workListitems to save - method saveWorkListItems()");

	List items = SpecimenWorkListItemVoAssembler.extractSpecimenWorkListItemList(factory, workListitems, null, objMap);
	Iterator it = items.iterator();

	while (it.hasNext())
	{
		SpecimenWorkListItem item = (SpecimenWorkListItem) it.next();
		if(state.equals(ORDERSTATE.REQUESTING_AUTHORISATION))
			item.setCollectionStatus(getDomLookup(ims.ocrr.vo.lookups.SpecimenCollectionStatus.AWAITING_AUTHORISATION));

		factory.save(item);
	}

	workListitems = SpecimenWorkListItemVoAssembler.createSpecimenWorkListItemVoCollectionFromSpecimenWorkListItem(items);
	return workListitems;
}
 
Example 6
Project: openMAXIMS   File: SpecimenCollectionClinicImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if(orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);
	
	if(orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE) && doSpecimenWorkListItem.getSpecimen() != null)
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 7
Project: openMAXIMS   File: WardSpecimenCollectionImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if (orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();

	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);

	if(doSpecimenWorkListItem.getSpecimen()!=null && orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 8
Project: openMAXIMS   File: OutpatientPhlebotomyImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if(orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);
	
	if(orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 9
Project: openMAXIMS   File: BookSpecimenAppointmentDialogImpl.java   View source code 6 votes vote down vote up
public void saveWorkListItems(SpecimenWorkListItemLiteVoCollection workListItems) throws StaleObjectException
{
	if(workListItems == null)
		throw new CodingRuntimeException("workListItems is null in method saveWorkListItems");
	
	DomainFactory factory = getDomainFactory();
	
	List doWorkListItems = SpecimenWorkListItemLiteVoAssembler.extractSpecimenWorkListItemList(factory, workListItems);
	if(doWorkListItems != null && doWorkListItems.size() > 0)
	{
		Iterator it = doWorkListItems.iterator();
		while(it.hasNext())
		{
			SpecimenWorkListItem doWorkListItem =   (SpecimenWorkListItem)it.next();
			factory.save(doWorkListItem);
		}
	}
}
 
Example 10
Project: openMAXIMS   File: MyOrderImpl.java   View source code 6 votes vote down vote up
private SpecimenWorkListItemVoCollection saveWorkListItems(DomainFactory factory, SpecimenWorkListItemVoCollection workListitems, HashMap objMap, ORDERSTATE state) throws StaleObjectException
{
	if (workListitems == null)
		throw new CodingRuntimeException("No workListitems to save - method saveWorkListItems()");

	List items = SpecimenWorkListItemVoAssembler.extractSpecimenWorkListItemList(factory, workListitems, null, objMap);
	Iterator it = items.iterator();

	while (it.hasNext())
	{
		SpecimenWorkListItem item = (SpecimenWorkListItem) it.next();
		if(state.equals(ORDERSTATE.REQUESTING_AUTHORISATION))
			item.setCollectionStatus(getDomLookup(ims.ocrr.vo.lookups.SpecimenCollectionStatus.AWAITING_AUTHORISATION));

		factory.save(item);
	}

	workListitems = SpecimenWorkListItemVoAssembler.createSpecimenWorkListItemVoCollectionFromSpecimenWorkListItem(items);
	return workListitems;
}
 
Example 11
Project: openMAXIMS   File: SpecimenCollectionClinicImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if(orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);
	
	if(orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE) && doSpecimenWorkListItem.getSpecimen() != null)
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 12
Project: openMAXIMS   File: WardSpecimenCollectionImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if (orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();

	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);

	if(doSpecimenWorkListItem.getSpecimen()!=null && orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 13
Project: openMAXIMS   File: BookSpecimenAppointmentDialogImpl.java   View source code 6 votes vote down vote up
public void saveWorkListItems(SpecimenWorkListItemLiteVoCollection workListItems) throws StaleObjectException
{
	if(workListItems == null)
		throw new CodingRuntimeException("workListItems is null in method saveWorkListItems");
	
	DomainFactory factory = getDomainFactory();
	
	List doWorkListItems = SpecimenWorkListItemLiteVoAssembler.extractSpecimenWorkListItemList(factory, workListItems);
	if(doWorkListItems != null && doWorkListItems.size() > 0)
	{
		Iterator it = doWorkListItems.iterator();
		while(it.hasNext())
		{
			SpecimenWorkListItem doWorkListItem =   (SpecimenWorkListItem)it.next();
			factory.save(doWorkListItem);
		}
	}
}
 
Example 14
Project: openmaxims-linux   File: MyOrderImpl.java   View source code 6 votes vote down vote up
private SpecimenWorkListItemVoCollection saveWorkListItems(DomainFactory factory, SpecimenWorkListItemVoCollection workListitems, HashMap objMap, ORDERSTATE state) throws StaleObjectException
{
	if (workListitems == null)
		throw new CodingRuntimeException("No workListitems to save - method saveWorkListItems()");

	List items = SpecimenWorkListItemVoAssembler.extractSpecimenWorkListItemList(factory, workListitems, null, objMap);
	Iterator it = items.iterator();

	while (it.hasNext())
	{
		SpecimenWorkListItem item = (SpecimenWorkListItem) it.next();
		if(state.equals(ORDERSTATE.REQUESTING_AUTHORISATION))
			item.setCollectionStatus(getDomLookup(ims.ocrr.vo.lookups.SpecimenCollectionStatus.AWAITING_AUTHORISATION));

		factory.save(item);
	}

	workListitems = SpecimenWorkListItemVoAssembler.createSpecimenWorkListItemVoCollectionFromSpecimenWorkListItem(items);
	return workListitems;
}
 
Example 15
Project: openmaxims-linux   File: SpecimenCollectionClinicImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if(orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);
	
	if(orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE) && doSpecimenWorkListItem.getSpecimen() != null)
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 16
Project: openmaxims-linux   File: WardSpecimenCollectionImpl.java   View source code 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if (orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();

	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);

	if(doSpecimenWorkListItem.getSpecimen()!=null && orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 17
Project: AvoinApotti   File: MoveToWardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getSpecimenWorklistItem(Integer id)
{
	if (id == null)
		throw new CodingRuntimeException("Cannot get SpecimenWorklistItem on null Id.");

	return SpecimenWorkListItemListVoAssembler.create((SpecimenWorkListItem) getDomainFactory().getDomainObject(SpecimenWorkListItem.class, id));
}
 
Example 18
Project: AvoinApotti   File: MoveToWardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public void saveWorkListItem(SpecimenWorkListItemListVo specimenWorkListItem) throws StaleObjectException
{
	if (specimenWorkListItem == null)
		throw new CodingRuntimeException("Cannot save null specimenWorkListItem");

	if (!specimenWorkListItem.isValidated())
		throw new DomainRuntimeException("SpecimenWorkListItemVo Not Validated.");

	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem domainSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, specimenWorkListItem);

	factory.save(domainSpecimenWorkListItem);
}
 
Example 19
Project: AvoinApotti   File: SpecimenCollectionClinicImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getWorkListItem(Integer workListItemId)
{
	if(workListItemId == null)
		throw new CodingRuntimeException("Cannot get SpecimenWorkListItemListVo for null id");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = (SpecimenWorkListItem) factory.getDomainObject(SpecimenWorkListItem.class, workListItemId);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);		
}
 
Example 20
Project: AvoinApotti   File: PhelbotomyDefaultCollectorImpl.java   View source code 5 votes vote down vote up
public PhlebotomyRoundVo savePhlebotomyRound(PhlebotomyRoundVo phlebotomyRoundItem, SpecimenWorkListitemCustomVoCollection collectionItems) throws StaleObjectException
{
	//long t1 = System.currentTimeMillis();
	
	DomainFactory factory = getDomainFactory();
	
	PhlebotomyRound phlebotomyRoundItemBo = PhlebotomyRoundVoAssembler.extractPhlebotomyRound(factory, phlebotomyRoundItem);
	
	for (int i = 0; collectionItems!=null && i < collectionItems.size(); i++)//WDEV-12893
	{
		SpecimenWorkListItem workListItemBo = (SpecimenWorkListItem) factory.getDomainObject(SpecimenWorkListItem.class, collectionItems.get(i).getWorkListitemId());
		
		if(workListItemBo.getSpecimen() != null 
				&& workListItemBo.getSpecimen().getOrder() != null
				&& workListItemBo.getSpecimen().getOrder().getPatient() != null)
		{
			//workListItemBo.setWard(workListItemBo.getSpecimen().getOrder().getPatient().getWard());
			workListItemBo.setWard((Location) factory.getDomainObject(Location.class, collectionItems.get(i).getWardId()));
			factory.save(workListItemBo);
		}
		else if (workListItemBo.getDFTOrderInvestigation() != null)
		{
			workListItemBo.setWard((Location) factory.getDomainObject(Location.class, collectionItems.get(i).getWardId()));
			workListItemBo.setCollectionStatus(factory.getLookupInstance(SpecimenCollectionStatus.COLLECTIONCOMPLETE.getId()));
		}
		
		phlebotomyRoundItemBo.getCollectionItems().add(workListItemBo);
	}
	
	factory.save(phlebotomyRoundItemBo);
	
	//long t2 = System.currentTimeMillis();
	
	//System.out.println((t2-t1) + " ms");
	
	return PhlebotomyRoundVoAssembler.create(phlebotomyRoundItemBo);
}
 
Example 21
Project: AvoinApotti   File: WardSpecimenMoveToImpl.java   View source code 5 votes vote down vote up
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 22
Project: AvoinApotti   File: WardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVoCollection markWorkListItemsAsPrinted(SpecimenWorkListItemListVoCollection workListItemCollection) throws StaleObjectException
{
	SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection();
	DomainFactory factory = getDomainFactory();
	for (int i = 0; i < workListItemCollection.size(); i++)
	{
		SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, workListItemCollection.get(i));
		factory.save(doSpecimenWorkListItem);
		voColl.add(SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem));
	}
	return voColl;
}
 
Example 23
Project: AvoinApotti   File: WardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getSpecimenWorkListItem(Integer specimenId)
{
	if(specimenId == null)
		throw new CodingRuntimeException("Cannot get Specimen on null Id.");
	
	return SpecimenWorkListItemListVoAssembler.create((SpecimenWorkListItem) getDomainFactory().getDomainObject(SpecimenWorkListItem.class, specimenId));
}
 
Example 24
Project: AvoinApotti   File: OrderSummaryImpl.java   View source code 5 votes vote down vote up
private void updateSpecimenWorkListItemsForDFT(List<?> orderInvestigations) throws StaleObjectException
{
	if (orderInvestigations == null)
		return;
	
	StringBuilder dftInvestigations = new StringBuilder();
	
	Iterator<?> investigationIterator = orderInvestigations.iterator();
	while (investigationIterator.hasNext())
	{
		OrderInvestigation investigation = (OrderInvestigation) investigationIterator.next();
		
		if (getDomLookup(InvEventType.TIME_SERIES).equals(investigation.getInvestigation().getEventType()))
		{
			if (dftInvestigations.length() > 0)
				dftInvestigations.append(", ");
			dftInvestigations.append(investigation.getId());
		}
	}
	
	if (dftInvestigations.length() > 0)
	{
		List<?> workListItems = getDomainFactory().find("SELECT item FROM SpecimenWorkListItem AS item LEFT JOIN item.dFTOrderInvestigation AS investigation WHERE investigation.id in (" + dftInvestigations.toString() + ")");
		if (workListItems != null && workListItems.size() > 0)
		{
			Iterator<?> worklistIterator = workListItems.iterator();
			while (worklistIterator.hasNext())
			{
				SpecimenWorkListItem worklistItem = (SpecimenWorkListItem) worklistIterator.next();
				worklistItem.setCollectionStatus(getDomLookup(SpecimenCollectionStatus.CANCELLED));
				getDomainFactory().save(worklistItem);
			}
		}
	}
}
 
Example 25
Project: AvoinApotti   File: OrderSummaryImpl.java   View source code 5 votes vote down vote up
/**
 * get a distinct list of the specimens and check for a work list item for each one
 * If one (specimenworklistitem) is found update its SpecimenCollectionStatus to CANCELLED
 * @param doOrdInvs
 */
private void updateSpecimenWorkListItems(List doOrdInvs)  throws StaleObjectException
{
	if (doOrdInvs == null)
		throw new CodingRuntimeException("doOrdInvs cannot be null in method updateSpecimenWorkListItems");
	
	HashMap map = new HashMap<Integer, OrderSpecimen>(); //list of distinct specimens
	Iterator it = doOrdInvs.iterator();
	while(it.hasNext())
	{
		OrderInvestigation doOrdInv = (OrderInvestigation) it.next();
		
		if(doOrdInv.getSpecimen() != null && doOrdInv.getSpecimen().size() > 0)				//wdev-16488
		{
			if(areAllInvestigationsCancelled((OrderSpecimen) doOrdInv.getSpecimen().get(0)))
				map.put(((OrderSpecimen)doOrdInv.getSpecimen().get(0)).getId(), doOrdInv.getSpecimen());
		}
	}
	if(map.size() > 0)
	{
		String idsValues = getSpecimenIdsFromMap(map);
		
		if(idsValues != null && !idsValues.equals(""))
		{
			List workListItems = getDomainFactory().find("from SpecimenWorkListItem item where item.specimen.id in ( " + idsValues + " ) ");
			if(workListItems != null && workListItems.size() > 0)
			{
				Iterator it3 = workListItems.iterator();
				while (it3.hasNext())
				{
					SpecimenWorkListItem item = (SpecimenWorkListItem) it3.next();
					item.setCollectionStatus( getDomLookup( SpecimenCollectionStatus.CANCELLED));
					getDomainFactory().save(item);
				}
			}
		}
		
	}
}
 
Example 26
Project: openMAXIMS   File: MoveToWardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getSpecimenWorklistItem(Integer id)
{
	if (id == null)
		throw new CodingRuntimeException("Cannot get SpecimenWorklistItem on null Id.");

	return SpecimenWorkListItemListVoAssembler.create((SpecimenWorkListItem) getDomainFactory().getDomainObject(SpecimenWorkListItem.class, id));
}
 
Example 27
Project: openMAXIMS   File: MoveToWardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public void saveWorkListItem(SpecimenWorkListItemListVo specimenWorkListItem) throws StaleObjectException
{
	if (specimenWorkListItem == null)
		throw new CodingRuntimeException("Cannot save null specimenWorkListItem");

	if (!specimenWorkListItem.isValidated())
		throw new DomainRuntimeException("SpecimenWorkListItemVo Not Validated.");

	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem domainSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, specimenWorkListItem);

	factory.save(domainSpecimenWorkListItem);
}
 
Example 28
Project: openMAXIMS   File: SpecimenCollectionClinicImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getWorkListItem(Integer workListItemId)
{
	if(workListItemId == null)
		throw new CodingRuntimeException("Cannot get SpecimenWorkListItemListVo for null id");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = (SpecimenWorkListItem) factory.getDomainObject(SpecimenWorkListItem.class, workListItemId);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);		
}
 
Example 29
Project: openMAXIMS   File: PhelbotomyDefaultCollectorImpl.java   View source code 5 votes vote down vote up
public PhlebotomyRoundVo savePhlebotomyRound(PhlebotomyRoundVo phlebotomyRoundItem, SpecimenWorkListitemCustomVoCollection collectionItems) throws StaleObjectException
{
	//long t1 = System.currentTimeMillis();
	
	DomainFactory factory = getDomainFactory();
	
	PhlebotomyRound phlebotomyRoundItemBo = PhlebotomyRoundVoAssembler.extractPhlebotomyRound(factory, phlebotomyRoundItem);
	
	for (int i = 0; collectionItems!=null && i < collectionItems.size(); i++)//WDEV-12893
	{
		SpecimenWorkListItem workListItemBo = (SpecimenWorkListItem) factory.getDomainObject(SpecimenWorkListItem.class, collectionItems.get(i).getWorkListitemId());
		
		if(workListItemBo.getSpecimen() != null 
				&& workListItemBo.getSpecimen().getOrder() != null
				&& workListItemBo.getSpecimen().getOrder().getPatient() != null)
		{
			//workListItemBo.setWard(workListItemBo.getSpecimen().getOrder().getPatient().getWard());
			workListItemBo.setWard((Location) factory.getDomainObject(Location.class, collectionItems.get(i).getWardId()));
			factory.save(workListItemBo);
		}
		else if (workListItemBo.getDFTOrderInvestigation() != null)
		{
			workListItemBo.setWard((Location) factory.getDomainObject(Location.class, collectionItems.get(i).getWardId()));
			workListItemBo.setCollectionStatus(factory.getLookupInstance(SpecimenCollectionStatus.COLLECTIONCOMPLETE.getId()));
		}
		
		phlebotomyRoundItemBo.getCollectionItems().add(workListItemBo);
	}
	
	factory.save(phlebotomyRoundItemBo);
	
	//long t2 = System.currentTimeMillis();
	
	//System.out.println((t2-t1) + " ms");
	
	return PhlebotomyRoundVoAssembler.create(phlebotomyRoundItemBo);
}
 
Example 30
Project: openMAXIMS   File: WardSpecimenMoveToImpl.java   View source code 5 votes vote down vote up
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 31
Project: openMAXIMS   File: WardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVoCollection markWorkListItemsAsPrinted(SpecimenWorkListItemListVoCollection workListItemCollection) throws StaleObjectException
{
	SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection();
	DomainFactory factory = getDomainFactory();
	for (int i = 0; i < workListItemCollection.size(); i++)
	{
		SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, workListItemCollection.get(i));
		factory.save(doSpecimenWorkListItem);
		voColl.add(SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem));
	}
	return voColl;
}
 
Example 32
Project: openMAXIMS   File: WardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getSpecimenWorkListItem(Integer specimenId)
{
	if(specimenId == null)
		throw new CodingRuntimeException("Cannot get Specimen on null Id.");
	
	return SpecimenWorkListItemListVoAssembler.create((SpecimenWorkListItem) getDomainFactory().getDomainObject(SpecimenWorkListItem.class, specimenId));
}
 
Example 33
Project: openMAXIMS   File: OutpatientPhlebotomyImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getWorkListItem(Integer workListItemId)
{
	if(workListItemId == null)
		throw new CodingRuntimeException("Cannot get SpecimenWorkListItemListVo for null id");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = (SpecimenWorkListItem) factory.getDomainObject(SpecimenWorkListItem.class, workListItemId);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);		
}
 
Example 34
Project: openMAXIMS   File: OrderSummaryImpl.java   View source code 5 votes vote down vote up
private void updateSpecimenWorkListItemsForDFT(List<?> orderInvestigations) throws StaleObjectException
{
	if (orderInvestigations == null)
		return;
	
	StringBuilder dftInvestigations = new StringBuilder();
	
	Iterator<?> investigationIterator = orderInvestigations.iterator();
	while (investigationIterator.hasNext())
	{
		OrderInvestigation investigation = (OrderInvestigation) investigationIterator.next();
		
		if (getDomLookup(InvEventType.TIME_SERIES).equals(investigation.getInvestigation().getEventType()))
		{
			if (dftInvestigations.length() > 0)
				dftInvestigations.append(", ");
			dftInvestigations.append(investigation.getId());
		}
	}
	
	if (dftInvestigations.length() > 0)
	{
		List<?> workListItems = getDomainFactory().find("SELECT item FROM SpecimenWorkListItem AS item LEFT JOIN item.dFTOrderInvestigation AS investigation WHERE investigation.id in (" + dftInvestigations.toString() + ")");
		if (workListItems != null && workListItems.size() > 0)
		{
			Iterator<?> worklistIterator = workListItems.iterator();
			while (worklistIterator.hasNext())
			{
				SpecimenWorkListItem worklistItem = (SpecimenWorkListItem) worklistIterator.next();
				worklistItem.setCollectionStatus(getDomLookup(SpecimenCollectionStatus.CANCELLED));
				getDomainFactory().save(worklistItem);
			}
		}
	}
}
 
Example 35
Project: openMAXIMS   File: OrderSummaryImpl.java   View source code 5 votes vote down vote up
/**
 * get a distinct list of the specimens and check for a work list item for each one
 * If one (specimenworklistitem) is found update its SpecimenCollectionStatus to CANCELLED
 * @param doOrdInvs
 */
private void updateSpecimenWorkListItems(List doOrdInvs)  throws StaleObjectException
{
	if (doOrdInvs == null)
		throw new CodingRuntimeException("doOrdInvs cannot be null in method updateSpecimenWorkListItems");
	
	HashMap map = new HashMap<Integer, OrderSpecimen>(); //list of distinct specimens
	Iterator it = doOrdInvs.iterator();
	while(it.hasNext())
	{
		OrderInvestigation doOrdInv = (OrderInvestigation) it.next();
		
		if(doOrdInv.getSpecimen() != null && doOrdInv.getSpecimen().size() > 0)				//wdev-16488
		{
			if(areAllInvestigationsCancelled((OrderSpecimen) doOrdInv.getSpecimen().get(0)))
				map.put(((OrderSpecimen)doOrdInv.getSpecimen().get(0)).getId(), doOrdInv.getSpecimen());
		}
	}
	if(map.size() > 0)
	{
		String idsValues = getSpecimenIdsFromMap(map);
		
		if(idsValues != null && !idsValues.equals(""))
		{
			List workListItems = getDomainFactory().find("from SpecimenWorkListItem item where item.specimen.id in ( " + idsValues + " ) ");
			if(workListItems != null && workListItems.size() > 0)
			{
				Iterator it3 = workListItems.iterator();
				while (it3.hasNext())
				{
					SpecimenWorkListItem item = (SpecimenWorkListItem) it3.next();
					item.setCollectionStatus( getDomLookup( SpecimenCollectionStatus.CANCELLED));
					getDomainFactory().save(item);
				}
			}
		}
		
	}
}
 
Example 36
Project: openMAXIMS   File: MoveToWardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getSpecimenWorklistItem(Integer id)
{
	if (id == null)
		throw new CodingRuntimeException("Cannot get SpecimenWorklistItem on null Id.");

	return SpecimenWorkListItemListVoAssembler.create((SpecimenWorkListItem) getDomainFactory().getDomainObject(SpecimenWorkListItem.class, id));
}
 
Example 37
Project: openMAXIMS   File: MoveToWardSpecimenCollectionImpl.java   View source code 5 votes vote down vote up
public void saveWorkListItem(SpecimenWorkListItemListVo specimenWorkListItem) throws StaleObjectException
{
	if (specimenWorkListItem == null)
		throw new CodingRuntimeException("Cannot save null specimenWorkListItem");

	if (!specimenWorkListItem.isValidated())
		throw new DomainRuntimeException("SpecimenWorkListItemVo Not Validated.");

	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem domainSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, specimenWorkListItem);

	factory.save(domainSpecimenWorkListItem);
}
 
Example 38
Project: openMAXIMS   File: SpecimenCollectionClinicImpl.java   View source code 5 votes vote down vote up
public SpecimenWorkListItemListVo getWorkListItem(Integer workListItemId)
{
	if(workListItemId == null)
		throw new CodingRuntimeException("Cannot get SpecimenWorkListItemListVo for null id");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = (SpecimenWorkListItem) factory.getDomainObject(SpecimenWorkListItem.class, workListItemId);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);		
}
 
Example 39
Project: openMAXIMS   File: PhelbotomyDefaultCollectorImpl.java   View source code 5 votes vote down vote up
public PhlebotomyRoundVo savePhlebotomyRound(PhlebotomyRoundVo phlebotomyRoundItem, SpecimenWorkListitemCustomVoCollection collectionItems) throws StaleObjectException
{
	//long t1 = System.currentTimeMillis();
	
	DomainFactory factory = getDomainFactory();
	
	PhlebotomyRound phlebotomyRoundItemBo = PhlebotomyRoundVoAssembler.extractPhlebotomyRound(factory, phlebotomyRoundItem);
	
	for (int i = 0; collectionItems!=null && i < collectionItems.size(); i++)//WDEV-12893
	{
		SpecimenWorkListItem workListItemBo = (SpecimenWorkListItem) factory.getDomainObject(SpecimenWorkListItem.class, collectionItems.get(i).getWorkListitemId());
		
		if(workListItemBo.getSpecimen() != null 
				&& workListItemBo.getSpecimen().getOrder() != null
				&& workListItemBo.getSpecimen().getOrder().getPatient() != null)
		{
			//workListItemBo.setWard(workListItemBo.getSpecimen().getOrder().getPatient().getWard());
			workListItemBo.setWard((Location) factory.getDomainObject(Location.class, collectionItems.get(i).getWardId()));
			factory.save(workListItemBo);
		}
		else if (workListItemBo.getDFTOrderInvestigation() != null)
		{
			workListItemBo.setWard((Location) factory.getDomainObject(Location.class, collectionItems.get(i).getWardId()));
			workListItemBo.setCollectionStatus(factory.getLookupInstance(SpecimenCollectionStatus.COLLECTIONCOMPLETE.getId()));
		}
		
		phlebotomyRoundItemBo.getCollectionItems().add(workListItemBo);
	}
	
	factory.save(phlebotomyRoundItemBo);
	
	//long t2 = System.currentTimeMillis();
	
	//System.out.println((t2-t1) + " ms");
	
	return PhlebotomyRoundVoAssembler.create(phlebotomyRoundItemBo);
}
 
Example 40
Project: openMAXIMS   File: WardSpecimenMoveToImpl.java   View source code 5 votes vote down vote up
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;
}