Java Code Examples for ims.core.vo.lookups.TaxonomyType

The following are top voted examples for showing how to use ims.core.vo.lookups.TaxonomyType. 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: OcsIfInboundImpl.java   Source Code and License 6 votes vote down vote up
public ServiceShortVo getServiceByTaxonomy(String externalCode, TaxonomyType taxonomy)
{
	if (externalCode == null || taxonomy == null)
		throw new DomainRuntimeException("Invalid parameters supplied to getDisciplineServiceByTaxonomy");
	
	DomainFactory factory = getDomainFactory();

	String hql = " from Service s " +
		" join s.taxonomyMap as cm" +
		" where cm.taxonomyName = :taxType " + 
		" and cm.taxonomyCode = :extId ";

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

	if (svcList != null && svcList.size() > 1)
	{
		throw new DomainRuntimeException("Duplicate data found for taxonomy type " + taxonomy + " and External Code = " + externalCode);
	}
	else if (svcList != null && svcList.size() == 1)
	{
		return ServiceShortVoAssembler.create((Service) svcList.get(0));
	}
	return null;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onCmbDocumentCategoryValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
	form.getLocalContext().setDocumentCategoryMapping(null);
	if(form.cmbDocumentCategory().getValue() != null )
	{
		LookupInstVo inst = LookupHelper.getDocumentCategoryInstance(this.domain.getLookupService(),form.cmbDocumentCategory().getValue().getID());
		LookupInstVo instMap = domain.getMappings(inst);
		LookupMappingVoCollection tempColl = instMap.getMappings().sort();
		
		for(int i = 0; tempColl != null && i < tempColl.size();i++)
		{
			if(tempColl.get(i) != null && TaxonomyType.EDRM.getText().equals(tempColl.get(i).getExtSystem()))
			{
				TaxonomySeedVo taxSeedVo = new TaxonomySeedVo();
				taxSeedVo.setID_TaxonomySeed(form.cmbDocumentCategory().getValue().getID());
				taxSeedVo.setExtCode(tempColl.get(i).getExtCode());
				taxSeedVo.setExtSystem(tempColl.get(i).getExtSystem());
				form.getLocalContext().setDocumentCategoryMapping(taxSeedVo);
				break;
			}
		}
	}
	
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadCmbExternalCode()
{
	form.cmbExternalCode().clear();
	TaxonomyTypeCollection coll = LookupHelper.getTaxonomyType(domain.getLookupService());
	for (int i = 0; i < coll.size(); i++)
	{
		TaxonomyType inst = coll.get(i);
		if ((inst.equals(TaxonomyType.READ3) ||
			inst.equals(TaxonomyType.SNOMED) ||
			inst.equals(TaxonomyType.ICD10) ||
			inst.equals(TaxonomyType.NAT_SPEC_CODE) ||
			inst.equals(TaxonomyType.NAT_TREAT_CODE) ||
			inst.equals(TaxonomyType.OPCS4) ||
			inst.equals(TaxonomyType.VTM) ||
			inst.equals(TaxonomyType.VMP) ||
			inst.equals(TaxonomyType.AMP))				
			&& inst.isActive())
		{
			form.cmbExternalCode().newRow(inst, inst.getText());
		}
	}
	
}
 
Example 4
Project: AvoinApotti   File: ClinicalImagingResultsImpl.java   Source Code and License 6 votes vote down vote up
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 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * Default in the search critera based on the details passed in the parameter
 * If the parameter is not null retrieve any matching records and populate the tree 
 * @param ClinicVo
 */	 
private void populateSearchCriteriaAndSearch(ClinicVo voClinic)
{
	if (voClinic != null && voClinic.getID_ClinicIsNotNull())
	{
		form.cmbSearchLoc().setValue(voClinic.getClinicLocation());
		
		//WDEV-11914
		loadSearchOutpatientDepartment(form.cmbSearchLoc().getValue());
		
		form.txtSearchName().setValue(voClinic.getClinicName());
		form.chkSearchAciveOnly().setValue(voClinic.getIsActive());
		
		if (voClinic.getID_ClinicIsNotNull() && (voClinic.getClinicNameIsNotNull() || voClinic.getMapping(TaxonomyType.PAS) != null || voClinic.getClinicLocationIsNotNull()))
		{
			search();
		}
	}
	
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getNacs(GpToPracticesForSummaryOverviewVo gp)
{
	if (gp == null)
		return null;
	if (!gp.getGpIsNotNull())
		return null;
	if (!gp.getGp().getCodeMappingsIsNotNull())
		return null;
	for (int i = 0 ; i < gp.getGp().getCodeMappings().size() ; i++)
	{
		if (gp.getGp().getCodeMappings().get(i).getTaxonomyName().getID() == TaxonomyType.NAT_GP_CODE.getID())
		{
			return gp.getGp().getCodeMappings().get(i).getTaxonomyCode();
		}
	}
	return null;
}
 
Example 7
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   Source Code and License 6 votes vote down vote up
public String getActiveHospitalCodeForClinic(ClinicRefVo clinicRefVo, TaxonomyType taxonomyType)
{
	DomainFactory factory = getDomainFactory();
	Clinic clinic = (Clinic)factory.getDomainObject(clinicRefVo);
	if (clinic==null)
		return null;
	
	Location loc = clinic.getClinicLocation();

	while (loc!=null&&(loc.isIsActive()&&loc.getType()!=null&&loc.getType().equals(getDomLookup(OrganisationType.HOSPITAL))))
	{
		loc=loc.getParentLocation();
	}
	if(loc!=null)
		return loc.getExtCode(taxonomyType.getID());
	return null;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String checkExchequerCodeIsUnique(ValueObjectRef voRef, TaxonomyMapCollection collTaxMap)
{
	if(ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (voRef != null && collTaxMap != null)
		{
			for (int i = 0; i < collTaxMap.size(); i++)
			{
				if (collTaxMap.get(i) != null
					&& collTaxMap.get(i).getTaxonomyNameIsNotNull() 
					&& collTaxMap.get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					String dupExchequer = domain.checkExchequerCodeIsUnique(collTaxMap.get(i).getTaxonomyCode(), voRef);
					
					if(dupExchequer != null)
						return dupExchequer;
				}

			}
				
		}
	}
	return null;
	
	
}
 
Example 9
Project: AvoinApotti   File: WebServicesIntegrationImpl.java   Source Code and License 6 votes vote down vote up
public void setUserRole(String sessionToken, String role) 
{	
	IAppRole appRole = getAppRoleByTaxonomyType(role, TaxonomyType.WEB_SERVICE);
	if (appRole == null)
	{		
		createSOAPFault(SystemLogLevel.ERROR, "'role' not found");
	}
	
	IAppUser user = getLoggedInUser();
	if (user != null)
	{
		IAppRoleLight userRole = user.getAppRole(appRole.getId());
		if (userRole == null)
		{		
			createSOAPFault(SystemLogLevel.WARNING, "User '" + user.getUsername() + "' doesn't have assigned role '" + appRole.getName() + "'");
		}
	}
	else
	{
		createSOAPFault(SystemLogLevel.WARNING, "WebService error: setUserRole - \n loggedin user is null");
	}
	
	SessionData sessData = getSessionData();
	sessData.role.set(appRole);			
}
 
Example 10
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   Source Code and License 6 votes vote down vote up
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 11
Project: AvoinApotti   File: TaxonomySearchImpl.java   Source Code and License 6 votes vote down vote up
private TaxonomyMapCollection searchVTMCodes(TaxonomyMap filter) 
{
	int maxRecords = ConfigFlag.DOM.TAXONOMY_SEARCH_MAX_SIZE.getValue();
	
	DomainFactory factory = getDomainFactory();
	String hqlList	= " from VTM vt where upper(vt.name) like :description";//WDEV-15115
	
	TaxonomyMapCollection coll = new TaxonomyMapCollection();
	List codesList = factory.find(hqlList, new String[] {"description"}, new Object[] {"%" + filter.getDescription().toUpperCase() + "%"}, maxRecords);//WDEV-15115			
	for (int i = 0; i < codesList.size(); i++)
	{
		VTM vtm = (VTM)codesList.get(i);
		TaxonomyMap taxMap = new TaxonomyMap();
		taxMap.setTaxonomyName(TaxonomyType.VTM);
		taxMap.setDescription(vtm.getName());
		taxMap.setTaxonomyCode(String.valueOf(vtm.getId()));			
		coll.add(taxMap);
	}		
	return coll; 
}
 
Example 12
Project: AvoinApotti   File: NewResultsImpl.java   Source Code and License 6 votes vote down vote up
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 13
Project: AvoinApotti   File: ApplicationRolesImpl.java   Source Code and License 6 votes vote down vote up
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 14
Project: AvoinApotti   File: TaxonomySearchImpl.java   Source Code and License 6 votes vote down vote up
private TaxonomyMapCollection searchICD10Codes(TaxonomyMap filter) throws ims.domain.exceptions.DomainRuntimeException
{
	int maxRecords = ConfigFlag.DOM.TAXONOMY_SEARCH_MAX_SIZE.getValue();

	DomainFactory factory = getDomainFactory();
	String hqlList	= " from Icd10AmProc p where (upper(p.ascii_desc) like :description) or upper(p.ascii_short_desc) like :description)";//WDEV-15115

	TaxonomyMapCollection coll = new TaxonomyMapCollection();
	List codesList = factory.find(hqlList, new String[] {"description"}, new Object[] {"%" + filter.getDescription().toUpperCase() + "%"}, maxRecords);	//WDEV-15115		
	for (int i = 0; i < codesList.size(); i++)
	{
		Icd10AmProc proc = (Icd10AmProc)codesList.get(i);
		TaxonomyMap taxMap = new TaxonomyMap();
		taxMap.setTaxonomyName(TaxonomyType.ICD10);
		taxMap.setDescription(proc.getAscii_short_desc() + " - " + proc.getAscii_desc());
		taxMap.setTaxonomyCode(proc.getCode_id());			
		coll.add(taxMap);
	}		
	return coll; 
}
 
Example 15
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
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 16
Project: AvoinApotti   File: BatchPrintingImpl.java   Source Code and License 6 votes vote down vote up
public LocSiteLiteVoCollection listHospitals(String name) 
{
	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	
	String hql = "select ls from LocSite as ls left join ls.codeMappings as t left join t.taxonomyName as tn where tn =:taxonomyType and ls.isActive = 1 and ls.type !=:SurgeryType and ls.isRIE is null and ls.isVirtual = 0";
	markers.add("SurgeryType");
	values.add(getDomLookup(LocationType.SURGERY));
	markers.add("taxonomyType");
	values.add(getDomLookup(TaxonomyType.PATH));
	
	if(name != null)
	{
		hql += " and ls.upperName like :locationName";
		markers.add("locationName");
		values.add(name.toUpperCase() + "%");
	}
	
	List list = getDomainFactory().find(hql, markers, values);
	
	return LocSiteLiteVoAssembler.createLocSiteLiteVoCollectionFromLocSite(list);
}
 
Example 17
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 6 votes vote down vote up
/**
 * wdev-9484
 * If this is a nursing clinic i.e. there is a CDS mapping starting with NURSE
 * return true. Otherwise return false.
 * @param factory
 * @param service
 * @return
 */
private boolean isNursingClinic(Service service)
{
	if (service == null || service.getTaxonomyMap() == null)
		return false;
	
	for (int i=0; i<service.getTaxonomyMap().size(); i++)
	{
		TaxonomyMap map = (TaxonomyMap) service.getTaxonomyMap().get(i);
		if (map.getTaxonomyName().getId() == TaxonomyType.CDS.getID() &&
				map.getTaxonomyCode().startsWith("NURSE"))
		{
			return true;
		}
	}
	
	return false;
}
 
Example 18
Project: AvoinApotti   File: TaxonomySearchCmpImpl.java   Source Code and License 6 votes vote down vote up
private TaxonomyMapCollection searchICD10Codes(TaxonomyMap filter) throws ims.domain.exceptions.DomainRuntimeException
{
	int maxRecords = ConfigFlag.DOM.TAXONOMY_SEARCH_MAX_SIZE.getValue();

	DomainFactory factory = getDomainFactory();
	String hqlList	= " from Icd10AmProc p where (upper(p.ascii_desc) like '%" + filter.getDescription().toUpperCase() + "%') or upper(p.ascii_short_desc) like '%" + filter.getDescription().toUpperCase() + "%')";

	TaxonomyMapCollection coll = new TaxonomyMapCollection();
	List codesList = factory.find(hqlList, maxRecords);			
	for (int i = 0; i < codesList.size(); i++)
	{
		Icd10AmProc proc = (Icd10AmProc)codesList.get(i);
		TaxonomyMap taxMap = new TaxonomyMap();
		taxMap.setTaxonomyName(TaxonomyType.ICD10);
		taxMap.setDescription(proc.getAscii_short_desc() + " - " + proc.getAscii_desc());
		taxMap.setTaxonomyCode(proc.getCode_id());			
		coll.add(taxMap);
	}		
	return coll; 
}
 
Example 19
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 6 votes vote down vote up
/**
 * wdev-9720
 * If this is a radiology clinic i.e. there is a CDS mapping starting with RADIOLOGY
 * return true. Otherwise return false.
 * @param factory
 * @param service
 * @return
 */
private boolean isRadiologyClinic(Service service)
{
	if (service == null || service.getTaxonomyMap() == null)
		return false;
	
	for (int i=0; i<service.getTaxonomyMap().size(); i++)
	{
		TaxonomyMap map = (TaxonomyMap) service.getTaxonomyMap().get(i);
		if (map.getTaxonomyName().getId() == TaxonomyType.CDS.getID() &&
				map.getTaxonomyCode().startsWith("RADIOLOGY"))
		{
			return true;
		}
	}
	
	return false;
}
 
Example 20
Project: AvoinApotti   File: Patient_SummaryImpl.java   Source Code and License 6 votes vote down vote up
public WorklistContactType getWorklistContactTypeByExternalCode(ContactType contactType)
{
	if (contactType == null)
		return null;

	LookupInstVo instContactType = LookupHelper.getContactTypeInstance(getLookupService(), contactType.getId());
	LookupInstVo instMap = getMappings(instContactType);
	LookupMappingVoCollection mapColl = instMap.getMappings();
	for (int j = 0; j < mapColl.size(); j++)
	{
		LookupMappingVo valueObject = mapColl.get(j);
		TaxonomyType taxonomyType = getExtSystemInstance(valueObject.getExtSystem());
		if (taxonomyType.equals(TaxonomyType.WORKLIST_MAPPING))
		{
			Integer codeVal = Integer.valueOf(valueObject.getExtCode());
			WorklistContactTypeCollection collWorklistContactType = LookupHelper.getWorklistContactType(getLookupService());
			for (int i = 0; i < collWorklistContactType.size(); i++)
			{
				if (codeVal == collWorklistContactType.get(i).getId())
					return collWorklistContactType.get(i);
			}
		}
	}

	return null;
}
 
Example 21
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 6 votes vote down vote up
private String getNatSpecialtyCode(Service service) 
{
	if (service == null)
	{
		super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "No Service found for referral");
		return null;
	}
			
	if (service.getTaxonomyMap() == null || service.getTaxonomyMap().size() == 0)
	{
		super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "No TaxonomyTypes found for this service - " + service.getServiceName());
		return null;
	}
	
	for (int i=0; i<service.getTaxonomyMap().size(); i++)
	{
		TaxonomyMap taxMap = (TaxonomyMap) service.getTaxonomyMap().get(i);
		if (taxMap.getTaxonomyName().getId() == TaxonomyType.NAT_SPEC_CODE.getId())
			return taxMap.getTaxonomyCode();
	}
	
	super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "TaxonomyType NAT_SPEC_CODE not found for this service - " + service.getServiceName());
	return null;
}
 
Example 22
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 6 votes vote down vote up
/**
 * wdev-11242
 * Get the Configured HRG Code for the given referral coded item
 * @param factory
 * @param refItem
 * @return String hrgCode or null
 */
@SuppressWarnings("rawtypes")
private String getHrgCode(DomainFactory factory, ReferralCodingItem refItem) 
{
	if (refItem == null || refItem.getOPCS4() == null)
		return null;
	
	String hql = " select hrg from HrgConfig hrg join hrg.mappings mp where mp.taxonomyCode = :opcs and mp.taxonomyName = :taxType";
	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	markers.add("opcs");
	values.add(refItem.getOPCS4());
	markers.add("taxType");
	values.add(getDomLookup(TaxonomyType.OPCS4));

	List lst = factory.find(hql, markers, values);
	if (lst != null && lst.size() > 0)
	{
		HrgConfig domHrg = (HrgConfig) lst.get(0);
		return domHrg.getHRGCode();
	}
	
	return null;
}
 
Example 23
Project: AvoinApotti   File: AllergiesImpl.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 24
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicLiteVo getMedicLiteByExternalCode(TaxonomyType taxType, String codeVal)
{
	if (taxType == null || codeVal == null) 
		throw new DomainRuntimeException("External Code and type not supplied for Medic");
	
	List hcpList = getDomHcpByExternalCode(taxType, codeVal);
	if (hcpList != null && hcpList.size() > 0)
	{
		Hcp hcp = (Hcp)hcpList.get(0);
		if (hcp instanceof Medic)
		{
			return MedicLiteVoAssembler.create((Medic)hcp);
		}
	}
	return null;
}
 
Example 25
Project: AvoinApotti   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected final void renderGpShortVoToXCN(GpShortVo gp,XCN xcn,ProviderSystemVo providerSystem) throws DataTypeException
{
	LOG.debug("VoMapper renderGpShortVoToXCN: entry");
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getForenameIsNotNull())
		xcn.getGivenName().setValue(gp.getName().getForename());
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getSurnameIsNotNull())
		xcn.getFamilyName().getSurname().setValue(gp.getName().getSurname());
	TaxonomyMap mapping = null;
	if (gp!=null)
		mapping = gp.getExternalCode(TaxonomyType.NAT_GP_CODE);
	if(mapping!=null)
	{
		xcn.getIDNumber().setValue(mapping.getTaxonomyCode());
	}
	if(gp!=null&&gp.getNameIsNotNull()&&gp.getName().getTitleIsNotNull())
		xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(gp.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
	LOG.debug("VoMapper renderGpShortVoToXCN: exit");
}
 
Example 26
Project: AvoinApotti   File: TaxonomyLoaderHelper.java   Source Code and License 6 votes vote down vote up
public TextileString getLoadReport(ims.core.vo.lookups.TaxonomyType codeType) {
	StringBuffer str = new StringBuffer();

	str.append(makeTextile(
			"<CENTER>*" + "Load Results for " + codeType.getText()
					+ "*</CENTER>", "SlateBlue", "tahoma", "14"));

	str.append(makeNewLine(new Integer(1)));
	str.append(makeTextile("Number of Records Inserted : ", "DarkRed",
			"tahoma", "12"));
	str.append(makeTextile(Integer.toString(getRecordsInserted()), "Black",
			"tahoma", "12").append(makeNewLine(new Integer(1))));

	str.append(makeNewLine(new Integer(1)));
	str.append(makeTextile("Number of Records Updated : ", "DarkRed",
			"tahoma", "12"));
	str.append(makeTextile(Integer.toString(getRecordsUpdated()), "Black",
			"tahoma", "12").append(makeNewLine(new Integer(1))));

	return new TextileString(str.toString());
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public GpShortVo getNewGpBasedOnSearchCriteria()
{
	GpShortVo voGpShort = new GpShortVo();
	voGpShort.setName(new PersonName());

	String forname = form.txtSearchForename().getValue();
	String surname = form.txtSearchSurname().getValue();
	TaxonomyType type = form.cmbSearchCodeType().getValue();

	voGpShort.getName().setForename(forname);
	voGpShort.getName().setUpperForename(forname != null ? forname.toUpperCase().substring(0, Math.min(voGpShort.getName().getUpperForenameMaxLength(), forname.length())) : null);
	voGpShort.getName().setSurname(surname);
	voGpShort.getName().setUpperSurname(surname != null ? surname.toUpperCase().substring(0, Math.min(voGpShort.getName().getUpperSurnameMaxLength(), surname.length())) : null);

	if (type != null)
	{
		voGpShort.setCodeMappings(new TaxonomyMapCollection());
		TaxonomyMap taxonomyMap = new TaxonomyMap();
		taxonomyMap.setTaxonomyName(type);
		taxonomyMap.setTaxonomyCode(form.txtSearchCode().getValue());
		voGpShort.getCodeMappings().add(taxonomyMap);
	}

	return voGpShort;
}
 
Example 28
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   Source Code and License 6 votes vote down vote up
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 29
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean checkMultipleSpecProcEXCHCode(ServiceActivityVo voServiceAct)
{
	if (voServiceAct.getTaxonomyMapIsNotNull())
	{
		int nCount = 0;
		Boolean bFound = false;
		for (int j = 0; j < voServiceAct.getTaxonomyMap().size(); j++)
		{
			if (voServiceAct.getTaxonomyMap().get(j).getTaxonomyNameIsNotNull() && voServiceAct.getTaxonomyMap().get(j).getTaxonomyName().equals(TaxonomyType.EXCH))
			{
				nCount++;
				bFound = true;
			}
		}
		if (nCount > 1)
		{
			engine.showMessage("There are more then one Procedure Exchequer codes configured. Please remove one.");
			return false;
		}

		return bFound;
	}
	return false;
}
 
Example 30
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   Source Code and License 6 votes vote down vote up
/**
* Gets the Active Hospital mapping for a particular location by walking up the Location tree until it hits a Hospital.
* http://jira/browse/WDEV-11637
*/

public String getActiveHospitalCodeForLoc(LocShortMappingsVo loc,TaxonomyType taxonomyType) {
	DomainFactory factory = getDomainFactory();
	Location location = (Location)factory.getDomainObject(loc);
	if (location==null)
		return null;

	while (location!=null&&
			(location.isIsActive()&&location.getType()!=null&&!location.getType().equals(getDomLookup(LocationType.HOSP)))
			)
	{
		location=location.getParentLocation();
	}
	if(location!=null)
		return location.getExtCode(taxonomyType.getID());
	return null;
}
 
Example 31
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicWithMappingsLiteVo getMedicMedicMappingsByExternalCode(TaxonomyType taxType, String codeVal)
{
	if (taxType == null || codeVal == null) 
		throw new DomainRuntimeException("External Code and type not supplied for Medic");
	
	List hcpList = getDomHcpByExternalCode(taxType, codeVal);
	if (hcpList != null && hcpList.size() > 0)
	{
		Hcp hcp = (Hcp)hcpList.get(0);
		if (hcp instanceof Medic)
		{
			return MedicWithMappingsLiteVoAssembler.create((Medic)hcp);
		}
	}
	return null;
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String checkExchequerCodeIsUnique(ValueObjectRef voRef, TaxonomyMapCollection collTaxMap)
{
	if(ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (voRef != null && collTaxMap != null)
		{
			for (int i = 0; i < collTaxMap.size(); i++)
			{
				if (collTaxMap.get(i) != null
					&& collTaxMap.get(i).getTaxonomyNameIsNotNull() 
					&& collTaxMap.get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					String dupExchequer = domain.checkExchequerCodeIsUnique(collTaxMap.get(i).getTaxonomyCode(), voRef);
					
					if(dupExchequer != null)
						return dupExchequer;
				}

			}
				
		}
	}
	return null;
	
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean checkMandatorySpecEXCHCode()
{
	if (form.lyr1().tabOrg().grdMappings().getRows().size() > 0)
	{			
		for(int x = 0; x < form.lyr1().tabOrg().grdMappings().getRows().size(); x++)
		{
			if (form.lyr1().tabOrg().grdMappings().getRows().get(x).getcolExtCodeType() != null &&
					form.lyr1().tabOrg().grdMappings().getRows().get(x).getcolExtCodeType().equals(TaxonomyType.EXCH))
			{		
				if ( ! NTPFExchequerCodingChecks.checkCodeIsAAANNN(form.lyr1().tabOrg().grdMappings().getRows().get(x).getcolCode()) )
				{
					engine.showMessage("The Supplier Exchequer code is not of the format AAANNN.");
					return false;
				}
				if (x == form.lyr1().tabOrg().grdMappings().getRows().size()-1)
					return true;
			}
		}
	}
	
	return true;
}
 
Example 34
Project: AvoinApotti   File: TaxonomySearchCmpImpl.java   Source Code and License 6 votes vote down vote up
private TaxonomyMapCollection searchOPCS4Codes(TaxonomyMap filter) 
{		
	int maxRecords = ConfigFlag.DOM.TAXONOMY_SEARCH_MAX_SIZE.getValue();
	
	DomainFactory factory = getDomainFactory();
	String hqlList	= " from Opcs4 opcs4 where upper(opcs4.opname4) like '%" + filter.getDescription().toUpperCase() + "%' or upper(opcs4.opname3) like '%" + filter.getDescription().toUpperCase() + "%')";
	
	TaxonomyMapCollection coll = new TaxonomyMapCollection();
	List codesList = factory.find(hqlList, maxRecords);			
	for (int i = 0; i < codesList.size(); i++)
	{
		Opcs4 proc = (Opcs4)codesList.get(i);
		TaxonomyMap taxMap = new TaxonomyMap();
		taxMap.setTaxonomyName(TaxonomyType.OPCS4);
		taxMap.setDescription(proc.getOpname3() + " - " + proc.getOpname4());
		taxMap.setTaxonomyCode(proc.getOpcode());			
		coll.add(taxMap);
	}		
	return coll; 

}
 
Example 35
Project: AvoinApotti   File: ChemotherapyDetailsImpl.java   Source Code and License 5 votes vote down vote up
public String getCCOClinicName(String strClinicCode) 
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql2 = new StringBuffer();
	hql2.append("select clin from Clinic clin left join clin.codeMappings as tax left join tax.taxonomyName as taxTyp where taxTyp = :taxonomyType and tax.taxonomyCode = '" + strClinicCode + "'");
	ClinicVoCollection voClinics = ClinicVoAssembler.createClinicVoCollectionFromClinic(factory.find(hql2.toString(),new String[]{"taxonomyType"},new Object[]{getDomLookup(TaxonomyType.PAS)}));
	if (voClinics != null && voClinics.size() > 0)
		return voClinics.get(0).getClinicName();
	else
		return null;
}
 
Example 36
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicByNationalCode(String natCode) 
{
	ims.core.vo.Hcp hcp = getHcpByExternalCode(TaxonomyType.NAT_CONS_CODE, natCode);
	if (hcp == null) return null;
	if (hcp instanceof MedicVo)
		return (MedicVo)hcp;
	else 
		return null;
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen() throws FormOpenException
{
	loadCmbExternalCode();
	
	form.cmbExternalCode().setEnabled(true);
	form.lblExternalCodeType().setEnabled(true);

	if (engine.getPreviousNonDialogFormName().equals(form.getForms().Clinical.PastMedicalHistory) && ConfigFlag.UI.DISABLE_EXTERNAL_CODE_TYPE.getValue())
	{
		form.cmbExternalCode().setEnabled(false);
		form.lblExternalCodeType().setEnabled(false);
	}

	form.txtSearchCriteria().setFocus();
	form.btnSelect().setEnabled(false);
	TaxonomyMap voTaxonomy = form.getGlobalContext().Core.getTaxonomyMap();
	if (voTaxonomy != null && voTaxonomy.getTaxonomyNameIsNotNull())
	{
		form.cmbExternalCode().setValue(voTaxonomy.getTaxonomyName());
	}
	else
	{
		if (form.cmbExternalCode().getValues().size() > 0)
			form.cmbExternalCode().setValue((TaxonomyType) form.cmbExternalCode().getValues().get(0));
	}
	if (form.getGlobalContext().Core.getTaxonomySearchForNameIsNotNull())
	{
		form.txtSearchCriteria().setValue(form.getGlobalContext().Core.getTaxonomySearchForName());
	}
}
 
Example 38
Project: AvoinApotti   File: DTOHelper.java   Source Code and License 5 votes vote down vote up
public static String getPasMapping(LookupInstance inst) 
{
	if(inst == null)
		return "";

	LookupMapping map = inst.getMapping(TaxonomyType.PAS.getText());
	if(map != null)
		return map.getExtCode();
	
	return null;
}
 
Example 39
Project: AvoinApotti   File: NTPFExchequerCodingChecks.java   Source Code and License 5 votes vote down vote up
public static String ValidHospitalSpecialty(LocationServiceVo voLocService)
{
	if (voLocService.getIsActiveIsNotNull() 
		&& ! voLocService.getIsActive().booleanValue())
		return "\r\nThe Hospital / Specialty link is not active. No editing is allowed";
	
	//Check Specialty is Active and has an Exchequer code
	if (voLocService.getServiceIsNotNull())
	{
		if (voLocService.getService().getIsActiveIsNotNull() 
			&& ! voLocService.getService().getIsActive().booleanValue())
			return "\r\nThe Specialty is not active. No editing is allowed";

		if (voLocService.getService().getTaxonomyMapIsNotNull())
		{
			boolean bFound = false;
			for(int i=0;i < voLocService.getService().getTaxonomyMap().size() ; i++)
			{
				//Has it an Exchequer code
				if (voLocService.getService().getTaxonomyMap().get(i).getTaxonomyNameIsNotNull()
					&& voLocService.getService().getTaxonomyMap().get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					bFound = true;
					//Is it a valid Exchequer code
					if ( ! checkCodeIsA6NNN(voLocService.getService().getTaxonomyMap().get(i).getTaxonomyCode()) )
						return "\r\nThe Specialty Exchequer code is not of the format 6NNN. No editing is allowed";
				}
			}
			if ( ! bFound)
				return "\r\nThe Specialty has no Exchequer code. No editing is allowed";

		}
	}
	return "";
}
 
Example 40
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public HcpRefVo getHcpRefByTaxonomyType(String extCode, TaxonomyType taxType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extCode, taxType);
	if (domMos == null)
		return null;
	else
	{
		return new HcpRefVo(domMos.getHcp().getId(),domMos.getHcp().getVersion()); 
	}
}