Java Code Examples for ims.core.vo.OrganisationVo.getLocationSitesIsNotNull()

The following are Jave code examples for showing how to use getLocationSitesIsNotNull() of the ims.core.vo.OrganisationVo 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: Logic.java   View Source Code Vote up 6 votes
/**
 * This functions sets up a practice for save and calls doSavePractice
 * @return boolean indicating success (true)
 */
private boolean savePractice()
{
	OrganisationVo practice = new OrganisationVo();
	
	if (form.getLocalContext().getPracticeIsNotNull())
		practice = form.getLocalContext().getPractice();
	practice = populatePracticeData(practice);
	
	practice.setType(OrganisationType.GPP);
	
	// this code adds a surgery to the value object if USE_GP_SURGERIES is false and if one doesn't already exist 
	// added to allow the ntpf to work as if using only practices. 
	if ( !practice.getLocationSitesIsNotNull())
	{				
		if (!canUseSurgery())
			practice = createOneMatchingChildSurgery(practice);
	}
	
	return doSavePractice(practice);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private LocSiteVo getSavedSurgery(OrganisationVo practiceBeforeSave, OrganisationVo practice, LocSiteVo surgery)
{
	if(practice == null)
		return null;
	
	int index = practice.getLocationSites().indexOf(surgery);
	if (index >= 0)
		return practice.getLocationSites().get(index);

	//Find the Location that's not in the practiceBeforeSave
	if(practiceBeforeSave != null && practiceBeforeSave.getLocationSitesIsNotNull())
	{
		for (int i = 0; i < practice.getLocationSites().size(); i++)
		{
			if(practiceBeforeSave.getLocationSites().indexOf(practice.getLocationSites().get(i)) < 0)
			{
				return practice.getLocationSites().get(i);
			}
		}
	}
	
	return null;
}
 
Example 3
Project: openMAXIMS   File: M02VoMapper.java   View Source Code Vote up 6 votes
private OrganisationVo updatePracticeStatus(OrganisationVo practiceVo)
{
if(practiceVo!=null&&practiceVo.getLocationSitesIsNotNull()&&practiceVo.getLocationSites().size()>0)
{
	practiceVo.setIsActive(Boolean.FALSE); //inactive 
	for (LocSiteVo surgery : practiceVo.getLocationSites())
	{
		if(surgery.getIsActiveIsNotNull()&&surgery.getIsActive().equals(Boolean.TRUE))
		{
			practiceVo.setIsActive(Boolean.TRUE); // if there is an active surgery the practice is active
			break;
		}
	}
}
return practiceVo;
}
 
Example 4
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 6 votes
/**
 * This functions sets up a practice for save and calls doSavePractice
 * @return boolean indicating success (true)
 */
private boolean savePractice()
{
	OrganisationVo practice = new OrganisationVo();
	
	if (form.getLocalContext().getPracticeIsNotNull())
		practice = form.getLocalContext().getPractice();
	practice = populatePracticeData(practice);
	
	practice.setType(OrganisationType.GPP);
	
	// this code adds a surgery to the value object if USE_GP_SURGERIES is false and if one doesn't already exist 
	// added to allow the ntpf to work as if using only practices. 
	if ( !practice.getLocationSitesIsNotNull())
	{				
		if (!canUseSurgery())
			practice = createOneMatchingChildSurgery(practice);
	}
	
	return doSavePractice(practice);
}
 
Example 5
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 6 votes
private LocSiteVo getSavedSurgery(OrganisationVo practiceBeforeSave, OrganisationVo practice, LocSiteVo surgery)
{
	if(practice == null)
		return null;
	
	int index = practice.getLocationSites().indexOf(surgery);
	if (index >= 0)
		return practice.getLocationSites().get(index);

	//Find the Location that's not in the practiceBeforeSave
	if(practiceBeforeSave != null && practiceBeforeSave.getLocationSitesIsNotNull())
	{
		for (int i = 0; i < practice.getLocationSites().size(); i++)
		{
			if(practiceBeforeSave.getLocationSites().indexOf(practice.getLocationSites().get(i)) < 0)
			{
				return practice.getLocationSites().get(i);
			}
		}
	}
	
	return null;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 6 votes
/**
 * This functions sets up a practice for save and calls doSavePractice
 * @return boolean indicating success (true)
 */
private boolean savePractice()
{
	OrganisationVo practice = new OrganisationVo();
	
	if (form.getLocalContext().getPracticeIsNotNull())
		practice = form.getLocalContext().getPractice();
	practice = populatePracticeData(practice);
	
	practice.setType(OrganisationType.GPP);
	
	// this code adds a surgery to the value object if USE_GP_SURGERIES is false and if one doesn't already exist 
	// added to allow the ntpf to work as if using only practices. 
	if ( !practice.getLocationSitesIsNotNull())
	{				
		if (!canUseSurgery())
			practice = createOneMatchingChildSurgery(practice);
	}
	
	return doSavePractice(practice);
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 6 votes
private LocSiteVo getSavedSurgery(OrganisationVo practiceBeforeSave, OrganisationVo practice, LocSiteVo surgery)
{
	if(practice == null)
		return null;
	
	int index = practice.getLocationSites().indexOf(surgery);
	if (index >= 0)
		return practice.getLocationSites().get(index);

	//Find the Location that's not in the practiceBeforeSave
	if(practiceBeforeSave != null && practiceBeforeSave.getLocationSitesIsNotNull())
	{
		for (int i = 0; i < practice.getLocationSites().size(); i++)
		{
			if(practiceBeforeSave.getLocationSites().indexOf(practice.getLocationSites().get(i)) < 0)
			{
				return practice.getLocationSites().get(i);
			}
		}
	}
	
	return null;
}
 
Example 8
Project: openmaxims-linux   File: Logic.java   View Source Code Vote up 6 votes
/**
 * This functions sets up a practice for save and calls doSavePractice
 * @return boolean indicating success (true)
 */
private boolean savePractice()
{
	OrganisationVo practice = new OrganisationVo();
	
	if (form.getLocalContext().getPracticeIsNotNull())
		practice = form.getLocalContext().getPractice();
	practice = populatePracticeData(practice);
	
	practice.setType(OrganisationType.GPP);
	
	// this code adds a surgery to the value object if USE_GP_SURGERIES is false and if one doesn't already exist 
	// added to allow the ntpf to work as if using only practices. 
	if ( !practice.getLocationSitesIsNotNull())
	{				
		if (!canUseSurgery())
			practice = createOneMatchingChildSurgery(practice);
	}
	
	return doSavePractice(practice);
}
 
Example 9
Project: openmaxims-linux   File: Logic.java   View Source Code Vote up 6 votes
private LocSiteVo getSavedSurgery(OrganisationVo practiceBeforeSave, OrganisationVo practice, LocSiteVo surgery)
{
	if(practice == null)
		return null;
	
	int index = practice.getLocationSites().indexOf(surgery);
	if (index >= 0)
		return practice.getLocationSites().get(index);

	//Find the Location that's not in the practiceBeforeSave
	if(practiceBeforeSave != null && practiceBeforeSave.getLocationSitesIsNotNull())
	{
		for (int i = 0; i < practice.getLocationSites().size(); i++)
		{
			if(practiceBeforeSave.getLocationSites().indexOf(practice.getLocationSites().get(i)) < 0)
			{
				return practice.getLocationSites().get(i);
			}
		}
	}
	
	return null;
}
 
Example 10
Project: AvoinApotti   File: GPPracticeAdminImpl.java   View Source Code Vote up 5 votes
public void deletePractice(OrganisationVo orgToDelete, Boolean deleteSurgery) throws ForeignKeyViolationException 
{
	if (deleteSurgery != null && deleteSurgery.booleanValue()) 
	{
		if(orgToDelete != null && orgToDelete.getLocationSitesIsNotNull() && orgToDelete.getLocationSites().size() == 1)
		{
			orgToDelete = deleteLocSite(orgToDelete.getLocationSites().get(0));
		}
	}

	deletePractice(orgToDelete);
}
 
Example 11
Project: openMAXIMS   File: GPPracticeAdminImpl.java   View Source Code Vote up 5 votes
public void deletePractice(OrganisationVo orgToDelete, Boolean deleteSurgery) throws ForeignKeyViolationException 
{
	if (deleteSurgery != null && deleteSurgery.booleanValue()) 
	{
		if(orgToDelete != null && orgToDelete.getLocationSitesIsNotNull() && orgToDelete.getLocationSites().size() == 1)
		{
			orgToDelete = deleteLocSite(orgToDelete.getLocationSites().get(0));
		}
	}

	deletePractice(orgToDelete);
}
 
Example 12
Project: openMAXIMS   File: GPPracticeAdminImpl.java   View Source Code Vote up 5 votes
public void deletePractice(OrganisationVo orgToDelete, Boolean deleteSurgery) throws ForeignKeyViolationException 
{
	if (deleteSurgery != null && deleteSurgery.booleanValue()) 
	{
		if(orgToDelete != null && orgToDelete.getLocationSitesIsNotNull() && orgToDelete.getLocationSites().size() == 1)
		{
			orgToDelete = deleteLocSite(orgToDelete.getLocationSites().get(0));
		}
	}

	deletePractice(orgToDelete);
}
 
Example 13
Project: openmaxims-linux   File: GPPracticeAdminImpl.java   View Source Code Vote up 5 votes
public void deletePractice(OrganisationVo orgToDelete, Boolean deleteSurgery) throws ForeignKeyViolationException 
{
	if (deleteSurgery != null && deleteSurgery.booleanValue()) 
	{
		if(orgToDelete != null && orgToDelete.getLocationSitesIsNotNull() && orgToDelete.getLocationSites().size() == 1)
		{
			orgToDelete = deleteLocSite(orgToDelete.getLocationSites().get(0));
		}
	}

	deletePractice(orgToDelete);
}