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()); 
	}
}
 
Example 41
Project: AvoinApotti   File: HL7PathwayIfImpl.java   Source Code and License 5 votes vote down vote up
/**
* Gets the event based on the RTT values passed in
 * @throws DomainInterfaceException 
*/
public ims.pathways.vo.EventVo getEventByTaxonomyMap(TaxonomyType taxType, String value) throws DomainInterfaceException
{
	if (taxType == null || value == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer(" select ev from Event ev join ev.taxonomyMaps tx where ev.status.id = :status and tx.taxonomyName = :taxType and tx.taxonomyCode = :taxCode");
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("status");
	labels.add("taxType");
	labels.add("taxCode");
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getId());
	values.add(getDomLookup(taxType));
	values.add(value);
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 1)
	{
		throw new DomainInterfaceException("Duplicate data found when searching event by Taxonomy ");
	}
	else if (lst != null && lst.size() == 1)
	{
		// Unique, so only one should be found??
		return EventVoAssembler.create((Event) lst.get(0));
	}
	
	return null;
}
 
Example 42
Project: AvoinApotti   File: DemographicsImpl.java   Source Code and License 5 votes vote down vote up
private TaxonomyMapCollection newTaxonomyMapFromDTORecord(Gp_practiceRecord gp_practice_record )
{
	TaxonomyMap voTaxonomy = new TaxonomyMap();
	voTaxonomy.setTaxonomyName(TaxonomyType.PAS);
	voTaxonomy.setTaxonomyCode(gp_practice_record.Gp_practice_id);
	voTaxonomy.setDescription("DTO GP Practice");
	TaxonomyMapCollection voCollTaxonomyMap = new TaxonomyMapCollection();
	voCollTaxonomyMap.add(voTaxonomy);
	return voCollTaxonomyMap;
}
 
Example 43
Project: AvoinApotti   File: AlertsImpl.java   Source Code and License 5 votes vote down vote up
public String[] listPatientAlertsTextByTaxonomy(PatientRefVo patient,
		Boolean active, TaxonomyType type) {
	if(patient == null)
		throw new CodingRuntimeException("Mandatory parameter - Patient not supplied");
	if(type == null)
		throw new CodingRuntimeException("Mandatory parameter - TaxonomyType not supplied");
	ArrayList names = new ArrayList();
	ArrayList values = new ArrayList();
	
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer("select patAlrt.alertType.text from PatientAlert patAlrt join patAlrt.alertType.mappings maps");
	hql.append(" where patAlrt.patient.id = :patient and maps.extSystem = :type and ( patAlrt.isRIE = false or patAlrt.isRIE is null )");
	names.add("patient");
	values.add(patient.getID_Patient());
	names.add("type");
	values.add(type.getIItemText());
	
	if (active.equals(Boolean.TRUE))
	{
		hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive");
		names.add("isActive");
		values.add(Boolean.TRUE);	
	}
	
	List<String> list = factory.find(hql.toString(), names,values);
	return list.toArray(new String[list.size()]) ;
}
 
Example 44
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
private String getPasMapping(Medic consultant) 
{
	if(consultant == null || consultant.getMos() == null || consultant.getMos().getCodeMappings() == null || consultant.getMos().getCodeMappings().size() == 0)
		return null;
	
	Iterator it = consultant.getMos().getCodeMappings().iterator();
	while(it.hasNext())
	{
		TaxonomyMap map = (TaxonomyMap) it.next();
		if(map.getTaxonomyName().equals(getDomLookup(TaxonomyType.PAS)))
			return map.getTaxonomyCode();
	}
	
	return null;
}
 
Example 45
Project: AvoinApotti   File: WebServicesIntegrationImpl.java   Source Code and License 5 votes vote down vote up
public void setStartupForm(String sessionToken, String form) 
{
	IAppForm appForm = getAppFormListByTaxonomyType(form, TaxonomyType.WEB_SERVICE);
	if (appForm == null)
	{		
		createSOAPFault(SystemLogLevel.ERROR, "'startupForm' not found");
	}
	SessionData sessData = getSessionData();
	sessData.openForm.set(Integer.valueOf(appForm.getFormId()));	
}
 
Example 46
Project: AvoinApotti   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
private String getPasMapping(Medic consultant) 
{
	if(consultant == null || consultant.getMos() == null || consultant.getMos().getCodeMappings() == null || consultant.getMos().getCodeMappings().size() == 0)
		return null;
	
	Iterator it = consultant.getMos().getCodeMappings().iterator();
	while(it.hasNext())
	{
		TaxonomyMap map = (TaxonomyMap) it.next();
		if(map.getTaxonomyName().equals(getDomLookup(TaxonomyType.PAS)))
			return map.getTaxonomyCode();
	}
	
	return null;
}
 
Example 47
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.HcpLiteVo getHcpLiteByExternalCode(TaxonomyType taxType, String codeVal)
{
if (codeVal == null) return null;
	
	List hcpList = getDomHcpByExternalCode(taxType, codeVal);

	if (hcpList != null && hcpList.size() > 0)
	{
		
		return HcpLiteVoAssembler.create((Hcp)hcpList.get(0));
	}
	return null;
	
}
 
Example 48
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 5 votes vote down vote up
private String getFirstAttendanceValue(Activity activity, String defaultVal)
{
	if (activity == null || activity.getCodeMappings() == null)
		return defaultVal; 
	
	for (int i=0; i<activity.getCodeMappings().size(); i++)
	{
		TaxonomyMap domMap = (TaxonomyMap) activity.getCodeMappings().get(i);
		if (domMap.getTaxonomyName().getId() == TaxonomyType.CDS.getID())
			return domMap.getTaxonomyCode();
	}
	return defaultVal;
}
 
Example 49
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 5 votes vote down vote up
private String getPracticeCode(Organisation practice) 
{
  	    // Practice is parent of surgery
	if (practice != null && practice.getCodeMappings() != null)
	{
		for (int i=0; i<practice.getCodeMappings().size(); i++)
		{
			TaxonomyMap mp = (TaxonomyMap) practice.getCodeMappings().get(i);
			if (mp.getTaxonomyName().getId() == TaxonomyType.NAT_LOC_CODE.getId())
				return mp.getTaxonomyCode();
		}
	}
	return UNKNOWN_PRACTICE;
}
 
Example 50
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 5 votes vote down vote up
private String getNationalLocCode(Location loc, String defaultSiteCode) 
{
	if (loc == null || loc.getCodeMappings() == null || loc.getCodeMappings().size() == 0)
		return defaultSiteCode;
	
	for (int i=0; i<loc.getCodeMappings().size(); i++)
	{
		TaxonomyMap mp = (TaxonomyMap) loc.getCodeMappings().get(i);
		if (mp.getTaxonomyName().getId() == TaxonomyType.NAT_LOC_CODE.getId())
			return mp.getTaxonomyCode();
	}
	
	return defaultSiteCode;
}
 
Example 51
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 5 votes vote down vote up
private String getICDCode(Diagnosis primaryDiagnosis) 
{
	for (int i=0; i<primaryDiagnosis.getTaxonomyMap().size(); i++)
	{
		TaxonomyMap map = (TaxonomyMap) primaryDiagnosis.getTaxonomyMap().get(i);
		if (map.getTaxonomyName().getId() == TaxonomyType.ICD10.getId())
			return map.getTaxonomyCode();
	}
		
	return null;
}
 
Example 52
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 5 votes vote down vote up
private String getConsMainSpecialty(DomainFactory factory, Hcp hcp)
{
	if (hcp == null)
		return null;
	Medic domMed = (Medic) factory.getDomainObject(Medic.class, hcp.getId());
	if (domMed != null)
	{
		return getExternalMapping(domMed.getSpecialty(), TaxonomyType.NAT_SPEC_CODE);
	}
	return null;
}
 
Example 53
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 5 votes vote down vote up
private String getNatConsultantCode(Hcp peformedBy) 
{
	if (peformedBy == null)
		return UNKNOWN_CONSULTANT;
	
	for (int i=0; i<peformedBy.getMos().getCodeMappings().size(); i++)
	{
		TaxonomyMap map = (TaxonomyMap) peformedBy.getMos().getCodeMappings().get(i);
		if (map.getTaxonomyName().getId() == TaxonomyType.NAT_CONS_CODE.getId())
			return map.getTaxonomyCode();
	}

	return UNKNOWN_CONSULTANT;
}
 
Example 54
Project: AvoinApotti   File: ManchesterTriageProtocolConfigImpl.java   Source Code and License 5 votes vote down vote up
private ManchesterTriageProtocolConfiguration getDiscriminatorRoleByTaxonomy(String taxonomyCode, TaxonomyType taxonomyName)
{
	if (taxonomyCode == null || taxonomyName == null)
		return null;

	DomainFactory factory = (DomainFactory) this.getDomainFactory();
	String hql = " from ManchesterTriageProtocolConfiguration tp join tp.taxonomyMap as tm where tm.taxonomyName = :taxType and tm.taxonomyCode = :extId ";
	List<?> discriminator = factory.find(hql, new String[] { "taxType", "extId" }, new Object[] { getDomLookup(taxonomyName), taxonomyCode });

	if (discriminator != null && discriminator.size() >= 1)
		return (ManchesterTriageProtocolConfiguration) discriminator.get(0);

	return null;
}
 
Example 55
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1)
{
	MedicRefVo hcp=null;
	XCN[] xcns = pv1.getReferringDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 56
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 57
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpRefVo populateHcpRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 58
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final HcpMinVo populateHcpMinFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getHcpMinByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 59
Project: AvoinApotti   File: CABRequests.java   Source Code and License 5 votes vote down vote up
private static String getExternalMapping(DomainFactory factory, String cancelReason, String defaultValue)
{
	if (cancelReason == null || cancelReason.equals(""))
		return defaultValue;
	
	LookupInstance inst = factory.getLookupInstance(Integer.parseInt(cancelReason));
	if (inst != null)
	{
		LookupMapping map = inst.getMapping(TaxonomyType.ICAB.getText());
		if (map != null)
			return (map.getExtCode());
	}
	return defaultValue;
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private TaxonomyMapCollection getMappings() 
{
	TaxonomyMapCollection voTaxonomyMapCollection =  new TaxonomyMapCollection();
	
	for (int i = 0; i < form.grdMappings().getRows().size(); i++)
	{
		GenForm.grdMappingsRow row = form.grdMappings().getRows().get(i);
		TaxonomyMap voTaxonomyMap = row.getValue() != null ? row.getValue() : new TaxonomyMap();
		voTaxonomyMap.setTaxonomyCode(row.getcolCode());			
		voTaxonomyMap.setTaxonomyName((TaxonomyType) row.getcolExtCodeType());
		
		if (row.getcolCode() != null && row.getcolExtCodeType() != null)
			voTaxonomyMapCollection.add(voTaxonomyMap);
		else
		{
			StringBuffer sb = new StringBuffer();
			sb.append("The taxonomy mapping of Type ");
			sb.append(row.getcolExtCodeType() != null ? "'" + ((TaxonomyType) row.getcolExtCodeType()).getText()+ "'" : "???");
			sb.append(" and Value of ");
			sb.append(row.getcolCode() != null ? "'" + row.getcolCode().toString()+ "'" : "???");
			sb.append(" will not be held for saving due to missing data.");
			engine.showMessage(sb.toString(),"Missing data", MessageButtons.OK, MessageIcon.WARNING);
		}
	}

	return voTaxonomyMapCollection;
}