Java Code Examples for ims.core.vo.lookups.TaxonomyType.getText()

The following are Jave code examples for showing how to use getText() of the ims.core.vo.lookups.TaxonomyType class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: OcsIfInboundImpl.java   Source Code and License Vote up 6 votes
public IfLocParentVo getLocParentByTaxType(String extId, TaxonomyType taxType)
{
	if (extId == null || taxType == null)
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from Location l " +
	" join l.codeMappings as cm" +
	" where cm.taxonomyName = :taxType " + 
	" and cm.taxonomyCode = :extId ";

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

	if (locList != null && locList.size() == 1)
	{
		return IfLocParentVoAssembler.create((Location)locList.get(0));
	}
	else if (locList != null && locList.size() > 1)
	{
		throw new DomainRuntimeException("Non unique hit on Location by TaxonomyType " + taxType.getText() + " and code " + extId);
	}
	else
		return null;
}
 
Example 2
Project: AvoinApotti   File: ApplicationRolesImpl.java   Source Code and License Vote up 6 votes
public AppRoleVo getAppRoleByTaxonomyType(String extId, TaxonomyType taxonomyType) 
{
	if (extId == null || taxonomyType == null)
		return null;
	
	DomainFactory factory = (DomainFactory) this.getDomainFactory();
	String hql = " from AppRole ar join ar.codeMappings as cm where cm.taxonomyName = :taxType and cm.taxonomyCode = :extId ";
	List appRole = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),extId});
		
	if (appRole != null && appRole.size() == 1)
		 return AppRoleVoAssembler.create((AppRole) appRole.get(0));
	else if (appRole != null && appRole.size() > 1)		
		throw new DomainRuntimeException("Non unique hit on AppRole by TaxonomyType " + taxonomyType.getText() + " and code " + extId);			
	
	return null;
}
 
Example 3
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   Source Code and License Vote up 6 votes
private Location getDomLocationByTaxonomyType(String extId, TaxonomyType taxonomyType, Class clazz)
{
	if (extId == null || taxonomyType == null)
		return null;

	String objName = (clazz.equals(Location.class)) ? "Location" : "LocSite";
	DomainFactory factory = getDomainFactory();
	String hql = " from " + objName + " l " +
	" join l.codeMappings as cm" +
	" where cm.taxonomyName = :taxType " + 
	" and cm.taxonomyCode = :extId ";

	List locList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),extId});

	if (locList != null && locList.size() == 1)
	{
		return (Location) locList.get(0);
	}
	else if (locList != null && locList.size() > 1)
	{
		throw new DomainRuntimeException("Non unique hit on Location by TaxonomyType " + taxonomyType.getText() + " and code " + extId);
	}
	else
		return null;
}
 
Example 4
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   Source Code and License Vote up 6 votes
private Organisation getDomOrganisationByTaxonomyType(String extId, TaxonomyType taxonomyType)
{
	if (extId == null || taxonomyType == null)
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from Organisation o " +
	" join o.codeMappings as cm" +
	" where cm.taxonomyName = :taxType " + 
	" and cm.taxonomyCode = :extId ";

	List orgList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),extId});

	if (orgList != null && orgList.size() == 1)
	{
		return (Organisation) orgList.get(0);
	}
	else if (orgList != null && orgList.size() > 1)
	{
		throw new DomainRuntimeException("Non unique hit on Organisation by TaxonomyType " + taxonomyType.getText() + " and code " + extId);
	}
	return null;
}
 
Example 5
Project: AvoinApotti   File: ApplicationFormsImpl.java   Source Code and License Vote up 6 votes
public AppFormListVo getAppFormListByTaxonomyType(String extId, TaxonomyType taxonomyType) 
{
	if (extId == null || taxonomyType == null)
		return null;
	
	DomainFactory factory = (DomainFactory) this.getDomainFactory();
	String hql = " from AppForm af join af.codeMappings as cm where cm.taxonomyName = :taxType and cm.taxonomyCode = :extId ";
	List appFormList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),extId});
		
	if (appFormList != null && appFormList.size() == 1)
		 return AppFormListVoAssembler.create((AppForm) appFormList.get(0));
	else if (appFormList != null && appFormList.size() > 1)		
		throw new DomainRuntimeException("Non unique hit on AppForm by TaxonomyType " + taxonomyType.getText() + " and code " + extId);			
	
	return null;
}
 
Example 6
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License Vote up 6 votes
private MemberOfStaff getDomMosByTaxonomyType(String extId, TaxonomyType taxonomyType)
{
	if (extId == null || taxonomyType == null)
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from MemberOfStaff m " +
	" join m.codeMappings as cm" +
	" where cm.taxonomyName = :taxType " + 
	" and cm.taxonomyCode = :extId ";

	List mosList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),extId});

	if (mosList == null || mosList.size() == 0)
	{
		return null;
	}
	else if (mosList.size() > 1)
	{
		throw new DomainRuntimeException("More than one MOS found with identifier type = " + taxonomyType.getText() + " and value = " + extId);
	}
	return (MemberOfStaff)mosList.get(0);
}
 
Example 7
Project: AvoinApotti   File: PathologyResultsImpl.java   Source Code and License Vote up 6 votes
public String getMappingForResultStatusLookup(ResultStatus resultStatusInstance, TaxonomyType extSystem) 
{
	if(resultStatusInstance == null || extSystem == null || extSystem.getText() == null)
		return null;
	
	String query = "select lm.extCode from LookupInstance as li left join li.mappings as lm where (li.id = :ResultStatusId and lm.extSystem = :TaxonomyType) ";
	
	List<?> list = getDomainFactory().find(query, new String[] {"ResultStatusId", "TaxonomyType"}, new Object[] {resultStatusInstance.getID(), extSystem.getText()});
	
	if(list != null && list.size() > 0)
	{
		if(list.get(0) instanceof String)
			return (String) list.get(0);
	}
	
	return null;
}
 
Example 8
Project: AvoinApotti   File: PathologyDialogImpl.java   Source Code and License Vote up 6 votes
public String getMappingForResultStatusLookup(ResultStatus resultStatusInstance, TaxonomyType extSystem) 
{
	if(resultStatusInstance == null || extSystem == null || extSystem.getText() == null)
		return null;
	
	String query = "select lm.extCode from LookupInstance as li left join li.mappings as lm where (li.id = :ResultStatusId and lm.extSystem = :TaxonomyType) ";
	
	List<?> list = getDomainFactory().find(query, new String[] {"ResultStatusId", "TaxonomyType"}, new Object[] {resultStatusInstance.getID(), extSystem.getText()});
	
	if(list != null && list.size() > 0)
	{
		if(list.get(0) instanceof String)
			return (String) list.get(0);
	}
	
	return null;
}
 
Example 9
Project: AvoinApotti   File: ClinicalImagingResultsImpl.java   Source Code and License Vote up 6 votes
public String getMappingForResultStatusLookup(ResultStatus resultStatusInstance, TaxonomyType extSystem) 
{
	if(resultStatusInstance == null || extSystem == null || extSystem.getText() == null)
		return null;
	
	String query = "select lm.extCode from LookupInstance as li left join li.mappings as lm where (li.id = :ResultStatusId and lm.extSystem = :TaxonomyType) ";
	
	List<?> list = getDomainFactory().find(query, new String[] {"ResultStatusId", "TaxonomyType"}, new Object[] {resultStatusInstance.getID(), extSystem.getText()});
	
	if(list != null && list.size() > 0)
	{
		if(list.get(0) instanceof String)
			return (String) list.get(0);
	}
	
	return null;
}
 
Example 10
Project: AvoinApotti   File: NewResultsImpl.java   Source Code and License Vote up 6 votes
public String getMappingForResultStatusLookup(ResultStatus resultStatusInstance, TaxonomyType extSystem) 
{
	if(resultStatusInstance == null || extSystem == null || extSystem.getText() == null)
		return null;
	
	String query = "select lm.extCode from LookupInstance as li left join li.mappings as lm where (li.id = :ResultStatusId and lm.extSystem = :TaxonomyType) ";
	
	List<?> list = getDomainFactory().find(query, new String[] {"ResultStatusId", "TaxonomyType"}, new Object[] {resultStatusInstance.getID(), extSystem.getText()});
	
	if(list != null && list.size() > 0)
	{
		if(list.get(0) instanceof String)
			return (String) list.get(0);
	}
	
	return null;
}
 
Example 11
Project: AvoinApotti   File: AllergiesImpl.java   Source Code and License Vote up 6 votes
public AllergenRefVo getAllergenForTaxonomy(TaxonomyType taxonomyType,String mapping)
{
	DomainFactory factory = getDomainFactory();
	String hql = " from Allergen alle join alle.taxonomyMap as tm where tm.taxonomyName = :taxType  and tm.taxonomyCode = :extId ";

	List alleList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),mapping});

	if (alleList != null && alleList.size() == 1)
	{
		
		Allergen allergenDom = (Allergen)alleList.get(0);
		
		AllergenRefVo allRef = new AllergenRefVo(allergenDom.getId(),allergenDom.getVersion()); 
		return allRef;
	}
	else if (alleList != null && alleList.size() > 1)
	{
		throw new DomainRuntimeException("Non unique hit on Allergen by TaxonomyType " + taxonomyType.getText() + " and code " + mapping);
	}
	else
		return null;
}