Java Code Examples for ims.core.vo.domain.LocMostVoAssembler

The following are top voted examples for showing how to use ims.core.vo.domain.LocMostVoAssembler. 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: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
public LocMostVoCollection listLocation(LocMostVo locationFilter)
	{
		List locations;
		if (locationFilter == null)
		{
//			wdev-2730
			StringBuffer hql = new StringBuffer();
			hql.append(" from LocSite as ls");
			hql.append(" where");
			hql.append(" and ls.isActive =:active");
			hql.append(" and ls.isRIE is null");
			hql.append(" and ls.isVirtual =:virtual");

			locations = getDomainFactory().find(hql.toString(), new String[]{"active", "virtual"}, new Object[]{Boolean.TRUE, Boolean.FALSE});
		}
		else
		{
			locations = listLocationsByParentLocation(locationFilter.getType(),locationFilter.getParentLocation(),locationFilter.getIsActive(),locationFilter.getReferringHospital(),locationFilter.getTreatingHosp(), null);
		}
		
		return LocMostVoAssembler.createLocMostVoCollectionFromLocation(locations).sort();
	}
 
Example 2
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
public LocMostVo getLocationByPostCode(String postCode) 
{
	if (postCode == null)
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from Location l where l.address.postCode = :postCode ";

	List locList = factory.find(hql,new String[]{"postCode"}, new Object[]{postCode});

	if (locList != null && locList.size() == 1)
	{
		return LocMostVoAssembler.create((Location) locList.get(0));
	}
	else if (locList != null && locList.size() > 1)
	{
		throw new DomainRuntimeException("Non unique hit on Location by Post Code " + postCode);
	}
	return null;
}
 
Example 3
Project: AvoinApotti   File: EDischargeListImpl.java   View source code 6 votes vote down vote up
private LocationRefVo getHospital(ims.core.resource.place.vo.LocationRefVo voRef)
{
	LocMostVo voLocation = LocMostVoAssembler.create((Location)getDomainFactory().getDomainObject(voRef));
	
	if(voLocation != null && voLocation.getType().equals(getDomLookup(LocationType.HOSP)))
		return (LocationRefVo) voLocation;

	while(voLocation != null && voLocation.getParentLocation() != null)
	{
		voLocation = voLocation.getParentLocation();
		if((voLocation instanceof LocMostVo) && (voLocation.getType().equals(LocationType.HOSP)))
			return (LocationRefVo) voLocation;
	}

	return voRef;
}
 
Example 4
Project: AvoinApotti   File: EDischargePatientReadyToLeaveComponentImpl.java   View source code 6 votes vote down vote up
private LocationRefVo getHospital(ims.core.resource.place.vo.LocationRefVo voRef)
{
	LocMostVo voLocation = LocMostVoAssembler.create((Location)getDomainFactory().getDomainObject(voRef));
	
	if(voLocation != null && voLocation.getType().equals(getDomLookup(LocationType.HOSP)))
		return (LocationRefVo) voLocation;

	while(voLocation != null && voLocation.getParentLocation() != null)
	{
		voLocation = voLocation.getParentLocation();
		if(voLocation instanceof LocMostVo && voLocation.getType().equals(LocationType.HOSP))
			return (LocationRefVo) voLocation;
	}

	return voRef;
}
 
Example 5
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
public LocMostVoCollection listLocation(LocMostVo locationFilter)
	{
		List locations;
		if (locationFilter == null)
		{
//			wdev-2730
			StringBuffer hql = new StringBuffer();
			hql.append(" from LocSite as ls");
			hql.append(" where");
			hql.append(" and ls.isActive =:active");
			hql.append(" and ls.isRIE is null");
			hql.append(" and ls.isVirtual =:virtual");

			locations = getDomainFactory().find(hql.toString(), new String[]{"active", "virtual"}, new Object[]{Boolean.TRUE, Boolean.FALSE});
		}
		else
		{
			locations = listLocationsByParentLocation(locationFilter.getType(),locationFilter.getParentLocation(),locationFilter.getIsActive(),locationFilter.getReferringHospital(),locationFilter.getTreatingHosp(),null, null); //WDEV-20395
		}
		
		return LocMostVoAssembler.createLocMostVoCollectionFromLocation(locations).sort();
	}
 
Example 6
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
public LocMostVo getLocationByPostCode(String postCode) 
{
	if (postCode == null)
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from Location l where l.address.postCode = :postCode ";

	List locList = factory.find(hql,new String[]{"postCode"}, new Object[]{postCode});

	if (locList != null && locList.size() == 1)
	{
		return LocMostVoAssembler.create((Location) locList.get(0));
	}
	else if (locList != null && locList.size() > 1)
	{
		throw new DomainRuntimeException("Non unique hit on Location by Post Code " + postCode);
	}
	return null;
}
 
Example 7
Project: openMAXIMS   File: EDischargeListImpl.java   View source code 6 votes vote down vote up
private LocationRefVo getHospital(ims.core.resource.place.vo.LocationRefVo voRef)
{
	LocMostVo voLocation = LocMostVoAssembler.create((Location)getDomainFactory().getDomainObject(voRef));
	
	if(voLocation != null && voLocation.getType().equals(getDomLookup(LocationType.HOSP)))
		return (LocationRefVo) voLocation;

	while(voLocation != null && voLocation.getParentLocation() != null)
	{
		voLocation = voLocation.getParentLocation();
		if((voLocation instanceof LocMostVo) && (voLocation.getType().equals(LocationType.HOSP)))
			return (LocationRefVo) voLocation;
	}

	return voRef;
}
 
Example 8
Project: openMAXIMS   File: EDischargePatientReadyToLeaveComponentImpl.java   View source code 6 votes vote down vote up
private LocationRefVo getHospital(ims.core.resource.place.vo.LocationRefVo voRef)
{
	LocMostVo voLocation = LocMostVoAssembler.create((Location)getDomainFactory().getDomainObject(voRef));
	
	if(voLocation != null && voLocation.getType().equals(getDomLookup(LocationType.HOSP)))
		return (LocationRefVo) voLocation;

	while(voLocation != null && voLocation.getParentLocation() != null)
	{
		voLocation = voLocation.getParentLocation();
		if(voLocation instanceof LocMostVo && voLocation.getType().equals(LocationType.HOSP))
			return (LocationRefVo) voLocation;
	}

	return voRef;
}
 
Example 9
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
public LocMostVoCollection listLocation(LocMostVo locationFilter)
	{
		List locations;
		if (locationFilter == null)
		{
//			wdev-2730
			StringBuffer hql = new StringBuffer();
			hql.append(" from LocSite as ls");
			hql.append(" where");
			hql.append(" and ls.isActive =:active");
			hql.append(" and ls.isRIE is null");
			hql.append(" and ls.isVirtual =:virtual");

			locations = getDomainFactory().find(hql.toString(), new String[]{"active", "virtual"}, new Object[]{Boolean.TRUE, Boolean.FALSE});
		}
		else
		{
			locations = listLocationsByParentLocation(locationFilter.getType(),locationFilter.getParentLocation(),locationFilter.getIsActive(),locationFilter.getReferringHospital(),locationFilter.getTreatingHosp(), null);
		}
		
		return LocMostVoAssembler.createLocMostVoCollectionFromLocation(locations).sort();
	}
 
Example 10
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
public LocMostVo getLocationByPostCode(String postCode) 
{
	if (postCode == null)
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from Location l where l.address.postCode = :postCode ";

	List locList = factory.find(hql,new String[]{"postCode"}, new Object[]{postCode});

	if (locList != null && locList.size() == 1)
	{
		return LocMostVoAssembler.create((Location) locList.get(0));
	}
	else if (locList != null && locList.size() > 1)
	{
		throw new DomainRuntimeException("Non unique hit on Location by Post Code " + postCode);
	}
	return null;
}
 
Example 11
Project: openMAXIMS   File: EDischargeListImpl.java   View source code 6 votes vote down vote up
private LocationRefVo getHospital(ims.core.resource.place.vo.LocationRefVo voRef)
{
	LocMostVo voLocation = LocMostVoAssembler.create((Location)getDomainFactory().getDomainObject(voRef));
	
	if(voLocation != null && voLocation.getType().equals(getDomLookup(LocationType.HOSP)))
		return (LocationRefVo) voLocation;

	while(voLocation != null && voLocation.getParentLocation() != null)
	{
		voLocation = voLocation.getParentLocation();
		if((voLocation instanceof LocMostVo) && (voLocation.getType().equals(LocationType.HOSP)))
			return (LocationRefVo) voLocation;
	}

	return voRef;
}
 
Example 12
Project: openMAXIMS   File: EDischargePatientReadyToLeaveComponentImpl.java   View source code 6 votes vote down vote up
private LocationRefVo getHospital(ims.core.resource.place.vo.LocationRefVo voRef)
{
	LocMostVo voLocation = LocMostVoAssembler.create((Location)getDomainFactory().getDomainObject(voRef));
	
	if(voLocation != null && voLocation.getType().equals(getDomLookup(LocationType.HOSP)))
		return (LocationRefVo) voLocation;

	while(voLocation != null && voLocation.getParentLocation() != null)
	{
		voLocation = voLocation.getParentLocation();
		if(voLocation instanceof LocMostVo && voLocation.getType().equals(LocationType.HOSP))
			return (LocationRefVo) voLocation;
	}

	return voRef;
}
 
Example 13
Project: openmaxims-linux   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
public LocMostVoCollection listLocation(LocMostVo locationFilter)
	{
		List locations;
		if (locationFilter == null)
		{
//			wdev-2730
			StringBuffer hql = new StringBuffer();
			hql.append(" from LocSite as ls");
			hql.append(" where");
			hql.append(" and ls.isActive =:active");
			hql.append(" and ls.isRIE is null");
			hql.append(" and ls.isVirtual =:virtual");

			locations = getDomainFactory().find(hql.toString(), new String[]{"active", "virtual"}, new Object[]{Boolean.TRUE, Boolean.FALSE});
		}
		else
		{
			locations = listLocationsByParentLocation(locationFilter.getType(),locationFilter.getParentLocation(),locationFilter.getIsActive(),locationFilter.getReferringHospital(),locationFilter.getTreatingHosp(), null);
		}
		
		return LocMostVoAssembler.createLocMostVoCollectionFromLocation(locations).sort();
	}
 
Example 14
Project: openmaxims-linux   File: OrganisationAndLocationImpl.java   View source code 6 votes vote down vote up
public LocMostVo getLocationByPostCode(String postCode) 
{
	if (postCode == null)
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from Location l where l.address.postCode = :postCode ";

	List locList = factory.find(hql,new String[]{"postCode"}, new Object[]{postCode});

	if (locList != null && locList.size() == 1)
	{
		return LocMostVoAssembler.create((Location) locList.get(0));
	}
	else if (locList != null && locList.size() > 1)
	{
		throw new DomainRuntimeException("Non unique hit on Location by Post Code " + postCode);
	}
	return null;
}
 
Example 15
Project: openmaxims-linux   File: EDischargeListImpl.java   View source code 6 votes vote down vote up
private LocationRefVo getHospital(ims.core.resource.place.vo.LocationRefVo voRef)
{
	LocMostVo voLocation = LocMostVoAssembler.create((Location)getDomainFactory().getDomainObject(voRef));
	
	if(voLocation != null && voLocation.getType().equals(getDomLookup(LocationType.HOSP)))
		return (LocationRefVo) voLocation;

	while(voLocation != null && voLocation.getParentLocation() != null)
	{
		voLocation = voLocation.getParentLocation();
		if((voLocation instanceof LocMostVo) && (voLocation.getType().equals(LocationType.HOSP)))
			return (LocationRefVo) voLocation;
	}

	return voRef;
}
 
Example 16
Project: openmaxims-linux   File: EDischargePatientReadyToLeaveComponentImpl.java   View source code 6 votes vote down vote up
private LocationRefVo getHospital(ims.core.resource.place.vo.LocationRefVo voRef)
{
	LocMostVo voLocation = LocMostVoAssembler.create((Location)getDomainFactory().getDomainObject(voRef));
	
	if(voLocation != null && voLocation.getType().equals(getDomLookup(LocationType.HOSP)))
		return (LocationRefVo) voLocation;

	while(voLocation != null && voLocation.getParentLocation() != null)
	{
		voLocation = voLocation.getParentLocation();
		if(voLocation instanceof LocMostVo && voLocation.getType().equals(LocationType.HOSP))
			return (LocationRefVo) voLocation;
	}

	return voRef;
}
 
Example 17
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   View source code 5 votes vote down vote up
public void deleteLocation(LocMostVo locToDelete) throws ForeignKeyViolationException
{
	DomainFactory factory = getDomainFactory();

	Location doLocation = LocMostVoAssembler.extractLocation(factory, locToDelete);

	if (doLocation.getServices().size() > 0)
	{
		throw new ForeignKeyViolationException("There are Services associated with this Location. Cannot delete.");
	}
	if (doLocation.getActivityLimitGroup().size() > 0)
	{
		throw new ForeignKeyViolationException("There are Activity Limits associated with this Location. Cannot delete.");
	}

	Location doParentLocation = doLocation.getParentLocation();
	if (doParentLocation != null)
		doParentLocation.getLocations().remove(doLocation);

	// WDEV - 12551 - Display an appropriate message
	// when deleting fails
	try
	{
		factory.delete(doLocation);
	}
	catch (Exception ex)
	{
		throw new ForeignKeyViolationException("Location is in use and can not be deleted.");
	}
}
 
Example 18
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   View source code 5 votes vote down vote up
public LocMostVoCollection listLocSite(OrgShortVo organisation)
{
	LocMostVoCollection voCollLocation = new LocMostVoCollection();
	DomainFactory factory = getDomainFactory();
	Organisation doOrganisation = (Organisation) factory.getDomainObject(Organisation.class, organisation.getID_Organisation());
	populateLocationCollection(LocMostVoAssembler.createLocMostVoCollectionFromLocation(doOrganisation.getLocationSites()), voCollLocation);
	return voCollLocation;
}
 
Example 19
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 5 votes vote down vote up
public void deleteLocation(LocMostVo locToDelete) throws ForeignKeyViolationException
{
	DomainFactory factory = getDomainFactory();

	Location doLocation = LocMostVoAssembler.extractLocation(factory, locToDelete);

	if (doLocation.getServices().size() > 0)
	{
		throw new ForeignKeyViolationException("There are Services associated with this Location. Cannot delete.");
	}
	if (doLocation.getActivityLimitGroup().size() > 0)
	{
		throw new ForeignKeyViolationException("There are Activity Limits associated with this Location. Cannot delete.");
	}

	Location doParentLocation = doLocation.getParentLocation();
	if (doParentLocation != null)
		doParentLocation.getLocations().remove(doLocation);

	// WDEV - 12551 - Display an appropriate message
	// when deleting fails
	try
	{
		factory.delete(doLocation);
	}
	catch (Exception ex)
	{
		throw new ForeignKeyViolationException("Location is in use and can not be deleted.");
	}
}
 
Example 20
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 5 votes vote down vote up
public LocMostVoCollection listLocSite(OrgShortVo organisation)
{
	LocMostVoCollection voCollLocation = new LocMostVoCollection();
	DomainFactory factory = getDomainFactory();
	Organisation doOrganisation = (Organisation) factory.getDomainObject(Organisation.class, organisation.getID_Organisation());
	populateLocationCollection(LocMostVoAssembler.createLocMostVoCollectionFromLocation(doOrganisation.getLocationSites()), voCollLocation);
	return voCollLocation;
}
 
Example 21
Project: openMAXIMS   File: TheatreReAdmissionDialogImpl.java   View source code 5 votes vote down vote up
public ims.core.vo.LocMostVo getLocation(ims.core.resource.place.vo.LocationRefVo location)
{
	if (location == null || location.getID_Location() == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, location.getID_Location()));
}
 
Example 22
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 5 votes vote down vote up
public void deleteLocation(LocMostVo locToDelete) throws ForeignKeyViolationException
{
	DomainFactory factory = getDomainFactory();

	Location doLocation = LocMostVoAssembler.extractLocation(factory, locToDelete);

	if (doLocation.getServices().size() > 0)
	{
		throw new ForeignKeyViolationException("There are Services associated with this Location. Cannot delete.");
	}
	if (doLocation.getActivityLimitGroup().size() > 0)
	{
		throw new ForeignKeyViolationException("There are Activity Limits associated with this Location. Cannot delete.");
	}

	Location doParentLocation = doLocation.getParentLocation();
	if (doParentLocation != null)
		doParentLocation.getLocations().remove(doLocation);

	// WDEV - 12551 - Display an appropriate message
	// when deleting fails
	try
	{
		factory.delete(doLocation);
	}
	catch (Exception ex)
	{
		throw new ForeignKeyViolationException("Location is in use and can not be deleted.");
	}
}
 
Example 23
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   View source code 5 votes vote down vote up
public LocMostVoCollection listLocSite(OrgShortVo organisation)
{
	LocMostVoCollection voCollLocation = new LocMostVoCollection();
	DomainFactory factory = getDomainFactory();
	Organisation doOrganisation = (Organisation) factory.getDomainObject(Organisation.class, organisation.getID_Organisation());
	populateLocationCollection(LocMostVoAssembler.createLocMostVoCollectionFromLocation(doOrganisation.getLocationSites()), voCollLocation);
	return voCollLocation;
}
 
Example 24
Project: openmaxims-linux   File: OrganisationAndLocationImpl.java   View source code 5 votes vote down vote up
public void deleteLocation(LocMostVo locToDelete) throws ForeignKeyViolationException
{
	DomainFactory factory = getDomainFactory();

	Location doLocation = LocMostVoAssembler.extractLocation(factory, locToDelete);

	if (doLocation.getServices().size() > 0)
	{
		throw new ForeignKeyViolationException("There are Services associated with this Location. Cannot delete.");
	}
	if (doLocation.getActivityLimitGroup().size() > 0)
	{
		throw new ForeignKeyViolationException("There are Activity Limits associated with this Location. Cannot delete.");
	}

	Location doParentLocation = doLocation.getParentLocation();
	if (doParentLocation != null)
		doParentLocation.getLocations().remove(doLocation);

	// WDEV - 12551 - Display an appropriate message
	// when deleting fails
	try
	{
		factory.delete(doLocation);
	}
	catch (Exception ex)
	{
		throw new ForeignKeyViolationException("Location is in use and can not be deleted.");
	}
}
 
Example 25
Project: openmaxims-linux   File: OrganisationAndLocationImpl.java   View source code 5 votes vote down vote up
public LocMostVoCollection listLocSite(OrgShortVo organisation)
{
	LocMostVoCollection voCollLocation = new LocMostVoCollection();
	DomainFactory factory = getDomainFactory();
	Organisation doOrganisation = (Organisation) factory.getDomainObject(Organisation.class, organisation.getID_Organisation());
	populateLocationCollection(LocMostVoAssembler.createLocMostVoCollectionFromLocation(doOrganisation.getLocationSites()), voCollLocation);
	return voCollLocation;
}
 
Example 26
Project: AvoinApotti   File: TransfersImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 27
Project: AvoinApotti   File: STHKCurrentInpatientListComponentImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 28
Project: AvoinApotti   File: PendingElectiveAdmissionsListELComponentImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(ims.core.resource.place.vo.LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 29
Project: AvoinApotti   File: PendingDischargesImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 30
Project: AvoinApotti   File: STHKPendingElectiveAdmissionsListComponentImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 31
Project: AvoinApotti   File: PendingEmergencyAdmissionsImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 32
Project: AvoinApotti   File: AvailableBedsImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef) 
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 33
Project: AvoinApotti   File: WardViewImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 34
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   View source code 4 votes vote down vote up
/**
 * Save Location
 */
public LocMostVo saveLocation(LocMostVo location) throws StaleObjectException, UniqueKeyViolationException
{
	if (!location.isValidated())
		throw new DomainRuntimeException("Location not Validated.");

	DomainFactory factory = getDomainFactory();

	HashMap<?,?> map = new HashMap<Object, Object>();
	Location doLocation = LocMostVoAssembler.extractLocation(factory, location,map);

	// uniqueness constraint removed form the database - must be implemented in code. 
	if (checkLocationNameIsUnique(location.getName(), location.getID_Location())!= null )
	{
		throw new UniqueKeyViolationException("A record with the same name already exists, Please change");
	}
	
	try
	{
		doLocation.setUpperNames();
		factory.save(doLocation);
		
		// wdev-6404 Clear REMOTE_LOC_CACHE on save
		REMOTE_LOC_CACHE.clear();
	}
	catch (UnqViolationUncheckedException e)
	{
		String dupMessage = Keywords.checkDuplicateTaxonomy(factory, doLocation, "codeMappings", location.getCodeMappings(), "getName");
		if(dupMessage != null)
			throw new UniqueKeyViolationException(dupMessage);
		//WDEV-12600 - Check if the child location don't contain duplicate mappings
		if (location.getLocationsIsNotNull())
		{
			checkChildsForDuplicateTaxonoy(location.getLocations(), map, factory);

		}
	

		throw new UniqueKeyViolationException("An Location with this name already exists, Please change", e);			
	}
	return LocMostVoAssembler.create(doLocation);
}
 
Example 35
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   View source code 4 votes vote down vote up
/**
 * moveLocation
 */
@SuppressWarnings("unchecked")
public void moveLocation(LocMostVo locToMove, ims.core.vo.LocSiteVo locSiteCurrentParent, LocMostVo locCurrentParent, ims.core.vo.LocSiteVo locSiteDestParent, LocMostVo locDestParent) throws StaleObjectException
{
	DomainFactory factory = getDomainFactory();

	Location doLocToMove = LocMostVoAssembler.extractLocation(factory, locToMove);
	Location doLocCurrentParent = LocMostVoAssembler.extractLocation(factory, locCurrentParent);
	Location doLocDestParent = LocMostVoAssembler.extractLocation(factory, locDestParent);

	LocSite doLocSiteCurrentParent = LocSiteVoAssembler.extractLocSite(factory, locSiteCurrentParent);
	LocSite doLocSiteDestParent = LocSiteVoAssembler.extractLocSite(factory, locSiteDestParent);

	if (doLocCurrentParent != null)
	{
		doLocToMove.setParentLocation(null);
		if (doLocCurrentParent.getLocations().size() > 0)
			doLocCurrentParent.getLocations().remove(doLocToMove);
	}
	else if (doLocSiteCurrentParent != null)
	{
		doLocToMove.setParentLocation(null);
		if (doLocSiteCurrentParent.getLocations().size() > 0)
			doLocSiteCurrentParent.getLocations().remove(doLocToMove);
	}

	if (locSiteDestParent != null)
	{
		doLocToMove.setParentLocation(doLocSiteDestParent);
		doLocSiteDestParent.getLocations().add(doLocToMove);
	}
	else if (locDestParent != null)
	{
		doLocToMove.setParentLocation(doLocDestParent);
		doLocDestParent.getLocations().add(doLocToMove);
	}
	if(doLocCurrentParent != null)
		factory.refresh(doLocCurrentParent);
	if(doLocSiteCurrentParent != null)
		factory.refresh(doLocSiteCurrentParent);
	
	factory.save(doLocToMove);
	
	//WDEV-10574
	REMOTE_LOC_CACHE.clear();

}
 
Example 36
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocMost(Integer id) 
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location)factory.getDomainObject(Location.class, id));
}
 
Example 37
Project: AvoinApotti   File: TheatreReAdmissionDialogImpl.java   View source code 4 votes vote down vote up
public ims.core.vo.LocMostVo getLocation(ims.core.resource.place.vo.LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 38
Project: AvoinApotti   File: ClinicListwithICPActionsImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef) 
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 39
Project: AvoinApotti   File: InpatientListwithICPActionsImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef) 
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}
 
Example 40
Project: openMAXIMS   File: TransfersImpl.java   View source code 4 votes vote down vote up
public LocMostVo getLocation(LocationRefVo voLocRef)
{
	DomainFactory factory = getDomainFactory();
	return LocMostVoAssembler.create((Location) factory.getDomainObject(Location.class, voLocRef.getID_Location()));
}