Java Code Examples for ims.core.resource.people.domain.objects.Hcp

The following are top voted examples for showing how to use ims.core.resource.people.domain.objects.Hcp. 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: NoLetterRequiredAdminConfigImpl.java   Source Code and License 6 votes vote down vote up
public MedicLiteVoCollection listConsultants(String textTyped) 
{
	if(textTyped == null)
		throw new CodingRuntimeException("Cannot search on null text!");
	
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics(textTyped);
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 2
Project: AvoinApotti   File: GlossaryAdminConfigurationImpl.java   Source Code and License 6 votes vote down vote up
private MedicLiteVoCollection listMedicsLite(String textToSearch) 
{
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics(textToSearch);
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 3
Project: AvoinApotti   File: ProceduresPerformedByHCPImpl.java   Source Code and License 6 votes vote down vote up
public HcpLiteVoCollection getAvailableHCPs(String filter) 
{
	DomainFactory factory=getDomainFactory();
	IMSCriteria imsc=new IMSCriteria(Hcp.class,factory);
	if (filter!=null)
	{
		imsc.join("this.mos", "mos");
		imsc.like("mos.name.surname", filter + "%");
	}
	List hcpColl=imsc.find();
	
	HcpLiteVoCollection hcps=HcpLiteVoAssembler.createHcpLiteVoCollectionFromHcp(hcpColl);
	HcpLiteVoCollection availableHcps=new HcpLiteVoCollection();
	
	removeAlreadyUsedHcps(hcps);
	
	for (int i=0;i<hcps.size();i++)
	{
		if (this.getAvailableServices(hcps.get(i).toHcpRefVo())!=null)
			availableHcps.add(hcps.get(i));
	}
	if (availableHcps.size()>0)
		return availableHcps;
	
	return null;
}
 
Example 4
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 5
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 6
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicVoCollection listAllMedics()
{
	MedicVoCollection voCollMedics = new MedicVoCollection();
	List lstMedics = listActiveMedics();
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedics.add(MedicVoAssembler.create((Medic) hcp));
		}
	}
	return voCollMedics;

}
 
Example 7
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffVo getMemberOfStaff(MemberOfStaffShortVo mos)
{
	MemberOfStaffVo newMosVo = new MemberOfStaffVo();
	if (mos.getID_MemberOfStaff() == null)
	{
		MemberOfStaffShortVoAssembler.copy(newMosVo, mos);
		return newMosVo;
	}

	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosDo = (MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, mos.getID_MemberOfStaff().intValue());
	MemberOfStaffVo mosVo = MemberOfStaffVoAssembler.create(mosDo);
	if (mosVo.getHcpIsNotNull())
	{
		HcpFilter voFilter = new HcpFilter();
		voFilter.setID_Hcp(mosVo.getHcp().getID_Hcp());
		ims.core.vo.Hcp vohcp = getHcp(voFilter);
		mosVo.setHcp(vohcp);
	}
	return mosVo;
}
 
Example 8
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffVo getMemberOfStaffByTaxonomyType(String extId, TaxonomyType taxonomyType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extId, taxonomyType);
	if (domMos == null)
		return null;
	
	MemberOfStaffVo mosVo = MemberOfStaffVoAssembler.create(domMos);
	ims.core.vo.Hcp hcp = null;
	if (domMos.getHcp() instanceof Medic)
	{
		hcp = MedicVoAssembler.create((Medic)domMos.getHcp());
	}
	else if (domMos.getHcp() instanceof Nurse)
	{
		hcp = NurseVoAssembler.create((Nurse)domMos.getHcp());
	}
	else if (domMos.getHcp() instanceof Therapist)
	{
		hcp = TherapistVoAssembler.create((Therapist)domMos.getHcp());
	}
	mosVo.setHcp(hcp);
	return mosVo;		
}
 
Example 9
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicLiteVoCollection listMedicsLite() 
{
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics();
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 10
Project: AvoinApotti   File: MyOrderImpl.java   Source Code and License 6 votes vote down vote up
public HcpLiteVo getInitiallySeenByHcpFromConsultationClinicalNotesByReferral(CatsReferralRefVo referral)
{
	if (referral == null || referral.getID_CatsReferral() == null)
		throw new CodingRuntimeException("referral is null or id not provided in method getInitiallySeenByHcpFromConsultationClinicalNotesByReferral");
			
	String hql = "select cons.initiallySeenBy.authoringHcp from ConsultationClinicalNotes as cons left join cons.catsReferral as referral where referral.id = " + referral.getID_CatsReferral() + " order by cons.systemInformation.creationDateTime desc ";
	List hcpList =  getDomainFactory().find(hql);
	if(hcpList != null && hcpList.size() >= 1)
	{
		Hcp doHcp = (Hcp)hcpList.get(0);
		if(doHcp != null)
			return HcpLiteVoAssembler.create(doHcp);
	}
		
	return null;
}
 
Example 11
Project: AvoinApotti   File: ExtendedClinicalNotesImpl.java   Source Code and License 6 votes vote down vote up
public HcpLiteVo getHcpLiteVoFOrMosID(Integer mosId) 
{
	if (mosId == null) 
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from Hcp h " +
	" where h.mos.id = :mosId";

	String[] names = new String[]{"mosId"};
	Object[] vals = new Object[]{mosId};
	List hcpList = factory.find(hql,names, vals);

	if (hcpList != null && hcpList.size() > 0)
		return HcpLiteVoAssembler.create((Hcp)hcpList.get(0));

	return null;
	
}
 
Example 12
Project: openMAXIMS   File: MyOrderImpl.java   Source Code and License 6 votes vote down vote up
public HcpLiteVo getInitiallySeenByHcpFromConsultationClinicalNotesByReferral(CatsReferralRefVo referral)
{
	if (referral == null || referral.getID_CatsReferral() == null)
		throw new CodingRuntimeException("referral is null or id not provided in method getInitiallySeenByHcpFromConsultationClinicalNotesByReferral");
			
	String hql = "select cons.initiallySeenBy.authoringHcp from ConsultationClinicalNotes as cons left join cons.catsReferral as referral where referral.id = " + referral.getID_CatsReferral() + " order by cons.systemInformation.creationDateTime desc ";
	List hcpList =  getDomainFactory().find(hql);
	if(hcpList != null && hcpList.size() >= 1)
	{
		Hcp doHcp = (Hcp)hcpList.get(0);
		if(doHcp != null)
			return HcpLiteVoAssembler.create(doHcp);
	}
		
	return null;
}
 
Example 13
Project: openMAXIMS   File: GlossaryAdminConfigurationImpl.java   Source Code and License 6 votes vote down vote up
private MedicLiteVoCollection listMedicsLite(String textToSearch) 
{
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics(textToSearch);
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 14
Project: openmaxims-linux   File: MyOrderImpl.java   Source Code and License 6 votes vote down vote up
public HcpLiteVo getInitiallySeenByHcpFromConsultationClinicalNotesByReferral(CatsReferralRefVo referral)
{
	if (referral == null || referral.getID_CatsReferral() == null)
		throw new CodingRuntimeException("referral is null or id not provided in method getInitiallySeenByHcpFromConsultationClinicalNotesByReferral");
			
	String hql = "select cons.initiallySeenBy.authoringHcp from ConsultationClinicalNotes as cons left join cons.catsReferral as referral where referral.id = " + referral.getID_CatsReferral() + " order by cons.systemInformation.creationDateTime desc ";
	List hcpList =  getDomainFactory().find(hql);
	if(hcpList != null && hcpList.size() >= 1)
	{
		Hcp doHcp = (Hcp)hcpList.get(0);
		if(doHcp != null)
			return HcpLiteVoAssembler.create(doHcp);
	}
		
	return null;
}
 
Example 15
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicLiteVoCollection listMedicsLite() 
{
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics();
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 16
Project: openMAXIMS   File: ExtendedClinicalNotesImpl.java   Source Code and License 6 votes vote down vote up
public HcpLiteVo getHcpLiteVoFOrMosID(Integer mosId) 
{
	if (mosId == null) 
		return null;

	DomainFactory factory = getDomainFactory();
	String hql = " from Hcp h " +
	" where h.mos.id = :mosId";

	String[] names = new String[]{"mosId"};
	Object[] vals = new Object[]{mosId};
	List hcpList = factory.find(hql,names, vals);

	if (hcpList != null && hcpList.size() > 0)
		return HcpLiteVoAssembler.create((Hcp)hcpList.get(0));

	return null;
	
}
 
Example 17
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffVo getMemberOfStaffByTaxonomyType(String extId, TaxonomyType taxonomyType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extId, taxonomyType);
	if (domMos == null)
		return null;
	
	MemberOfStaffVo mosVo = MemberOfStaffVoAssembler.create(domMos);
	ims.core.vo.Hcp hcp = null;
	if (domMos.getHcp() instanceof Medic)
	{
		hcp = MedicVoAssembler.create((Medic)domMos.getHcp());
	}
	else if (domMos.getHcp() instanceof Nurse)
	{
		hcp = NurseVoAssembler.create((Nurse)domMos.getHcp());
	}
	else if (domMos.getHcp() instanceof Therapist)
	{
		hcp = TherapistVoAssembler.create((Therapist)domMos.getHcp());
	}
	mosVo.setHcp(hcp);
	return mosVo;		
}
 
Example 18
Project: openMAXIMS   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 19
Project: openMAXIMS   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 20
Project: openmaxims-linux   File: GlossaryAdminConfigurationImpl.java   Source Code and License 6 votes vote down vote up
private MedicLiteVoCollection listMedicsLite(String textToSearch) 
{
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics(textToSearch);
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 21
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicVoCollection listAllMedics()
{
	MedicVoCollection voCollMedics = new MedicVoCollection();
	List lstMedics = listActiveMedics();
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedics.add(MedicVoAssembler.create((Medic) hcp));
		}
	}
	return voCollMedics;

}
 
Example 22
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffVo getMemberOfStaff(MemberOfStaffShortVo mos)
{
	MemberOfStaffVo newMosVo = new MemberOfStaffVo();
	if (mos.getID_MemberOfStaff() == null)
	{
		MemberOfStaffShortVoAssembler.copy(newMosVo, mos);
		return newMosVo;
	}

	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosDo = (MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, mos.getID_MemberOfStaff().intValue());
	MemberOfStaffVo mosVo = MemberOfStaffVoAssembler.create(mosDo);
	if (mosVo.getHcpIsNotNull())
	{
		HcpFilter voFilter = new HcpFilter();
		voFilter.setID_Hcp(mosVo.getHcp().getID_Hcp());
		ims.core.vo.Hcp vohcp = getHcp(voFilter);
		mosVo.setHcp(vohcp);
	}
	return mosVo;
}
 
Example 23
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffVo getMemberOfStaffByTaxonomyType(String extId, TaxonomyType taxonomyType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extId, taxonomyType);
	if (domMos == null)
		return null;
	
	MemberOfStaffVo mosVo = MemberOfStaffVoAssembler.create(domMos);
	ims.core.vo.Hcp hcp = null;
	if (domMos.getHcp() instanceof Medic)
	{
		hcp = MedicVoAssembler.create((Medic)domMos.getHcp());
	}
	else if (domMos.getHcp() instanceof Nurse)
	{
		hcp = NurseVoAssembler.create((Nurse)domMos.getHcp());
	}
	else if (domMos.getHcp() instanceof Therapist)
	{
		hcp = TherapistVoAssembler.create((Therapist)domMos.getHcp());
	}
	mosVo.setHcp(hcp);
	return mosVo;		
}
 
Example 24
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicLiteVoCollection listMedicsLite() 
{
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics();
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 25
Project: openmaxims-linux   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicLiteVoCollection listMedicsLite() 
{
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics();
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 26
Project: openmaxims-linux   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffVo getMemberOfStaff(MemberOfStaffShortVo mos)
{
	MemberOfStaffVo newMosVo = new MemberOfStaffVo();
	if (mos.getID_MemberOfStaff() == null)
	{
		MemberOfStaffShortVoAssembler.copy(newMosVo, mos);
		return newMosVo;
	}

	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosDo = (MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, mos.getID_MemberOfStaff().intValue());
	MemberOfStaffVo mosVo = MemberOfStaffVoAssembler.create(mosDo);
	if (mosVo.getHcpIsNotNull())
	{
		HcpFilter voFilter = new HcpFilter();
		voFilter.setID_Hcp(mosVo.getHcp().getID_Hcp());
		ims.core.vo.Hcp vohcp = getHcp(voFilter);
		mosVo.setHcp(vohcp);
	}
	return mosVo;
}
 
Example 27
Project: openmaxims-linux   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 28
Project: openMAXIMS   File: NoLetterRequiredAdminConfigImpl.java   Source Code and License 6 votes vote down vote up
public MedicLiteVoCollection listConsultants(String textTyped) 
{
	if(textTyped == null)
		throw new CodingRuntimeException("Cannot search on null text!");
	
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics(textTyped);
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 29
Project: openMAXIMS   File: GlossaryAdminConfigurationImpl.java   Source Code and License 6 votes vote down vote up
private MedicLiteVoCollection listMedicsLite(String textToSearch) 
{
	MedicLiteVoCollection voCollMedicsLite = new MedicLiteVoCollection();
	List lstMedics = listActiveMedics(textToSearch);
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedicsLite.add(MedicLiteVoAssembler.create((Medic) hcp));
		}
	}
	
	return voCollMedicsLite;
}
 
Example 30
Project: openmaxims-linux   File: ProceduresPerformedByHCPImpl.java   Source Code and License 6 votes vote down vote up
public HcpLiteVoCollection getAvailableHCPs(String filter) 
{
	DomainFactory factory=getDomainFactory();
	IMSCriteria imsc=new IMSCriteria(Hcp.class,factory);
	if (filter!=null)
	{
		imsc.join("this.mos", "mos");
		imsc.like("mos.name.surname", filter + "%");
	}
	List hcpColl=imsc.find();
	
	HcpLiteVoCollection hcps=HcpLiteVoAssembler.createHcpLiteVoCollectionFromHcp(hcpColl);
	HcpLiteVoCollection availableHcps=new HcpLiteVoCollection();
	
	removeAlreadyUsedHcps(hcps);
	
	for (int i=0;i<hcps.size();i++)
	{
		if (this.getAvailableServices(hcps.get(i).toHcpRefVo())!=null)
			availableHcps.add(hcps.get(i));
	}
	if (availableHcps.size()>0)
		return availableHcps;
	
	return null;
}
 
Example 31
Project: openMAXIMS   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: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MedicVoCollection listAllMedics()
{
	MedicVoCollection voCollMedics = new MedicVoCollection();
	List lstMedics = listActiveMedics();
	if (lstMedics != null)
	{
		for (int i = 0; i < lstMedics.size(); i++)
		{
			Hcp hcp = (Hcp) lstMedics.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				voCollMedics.add(MedicVoAssembler.create((Medic) hcp));
		}
	}
	return voCollMedics;

}
 
Example 33
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffVo getMemberOfStaff(MemberOfStaffShortVo mos)
{
	MemberOfStaffVo newMosVo = new MemberOfStaffVo();
	if (mos.getID_MemberOfStaff() == null)
	{
		MemberOfStaffShortVoAssembler.copy(newMosVo, mos);
		return newMosVo;
	}

	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosDo = (MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, mos.getID_MemberOfStaff().intValue());
	MemberOfStaffVo mosVo = MemberOfStaffVoAssembler.create(mosDo);
	if (mosVo.getHcpIsNotNull())
	{
		HcpFilter voFilter = new HcpFilter();
		voFilter.setID_Hcp(mosVo.getHcp().getID_Hcp());
		ims.core.vo.Hcp vohcp = getHcp(voFilter);
		mosVo.setHcp(vohcp);
	}
	return mosVo;
}
 
Example 34
Project: AvoinApotti   File: NeedsAssessmentImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcpLite(HcpRefVo hcpRefVo)
{
	if(hcpRefVo == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	return HcpLiteVoAssembler.create((Hcp)factory.getDomainObject(Hcp.class, hcpRefVo.getID_Hcp()));
}
 
Example 35
Project: AvoinApotti   File: ChemotherapyDetailsImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcp(IMos iMos)
{
	if (iMos == null || iMos.getIMosId() == null)
		return null;
	
	String query = "from Hcp as hcp where hcp.isRIE is null and hcp.mos.id = " + iMos.getIMosId().toString();
	
	return HcpLiteVoAssembler.create((Hcp) getDomainFactory().findFirst(query));
}
 
Example 36
Project: AvoinApotti   File: MOSQueryImpl.java   Source Code and License 5 votes vote down vote up
private IMos[] listByDiscipline(List hcps, String name, HcpDisType mosDiscipline) 
{
	List<IMos> hcpList = new ArrayList<IMos>();
	
	if(hcps != null)
	{			
		for(int i=0;i<hcps.size();i++)
		{
			Hcp hcp = (Hcp) hcps.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass()))
				hcpList.add(MedicVoAssembler.create((Medic)hcp));				
			else if (Therapist.class.isAssignableFrom(hcp.getClass()))
				hcpList.add(TherapistVoAssembler.create((Therapist)hcps.get(i)));
			else if (Nurse.class.isAssignableFrom(hcp.getClass()))
				hcpList.add(NurseVoAssembler.create((Nurse)hcps.get(i)));
			else
				hcpList.add(HcpAssembler.create((Hcp)hcps.get(i)));				
		}
	}
	Collections.sort(hcpList, new HcpAdminComparator(SortOrder.ASCENDING));		
	
	IMos[] iMosArray = new IMos[hcpList.size()];
	for(int i=0; i < hcpList.size(); i++)
		iMosArray[i] = hcpList.get(i);
		
	return iMosArray;	
}
 
Example 37
Project: AvoinApotti   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcpFromIMos(ims.vo.interfaces.IMos iMos)
{
	if (iMos == null || iMos.getIMosHcpId() == null)
		return null;
	
	return HcpLiteVoAssembler.create((Hcp) getDomainFactory().getDomainObject(Hcp.class, iMos.getIMosHcpId()));
}
 
Example 38
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 39
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 40
Project: AvoinApotti   File: ProceduresPerformedByHCPImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.HcpLiteVoCollection listHCP(String filter)
{
	DomainFactory factory = getDomainFactory();
	IMSCriteria imsc=new IMSCriteria(Hcp.class,factory);
	imsc.join("this.mos", "mos");
	imsc.like("mos.name.surname", filter + "%");
	List<Hcp> hcps=imsc.find();
	if (hcps.size()>0)
		return HcpLiteVoAssembler.createHcpLiteVoCollectionFromHcp(hcps);
	return null;
}
 
Example 41
Project: AvoinApotti   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public HcpDisType getCurrentUserDiscipline()
{
	if(getSession().getUser() != null && getSession().getUser().getHcpId() != null)
	{
		DomainFactory factory = getDomainFactory();
		
		Hcp hcp = (Hcp) factory.loadDomainObject(Hcp.class, getSession().getUser().getHcpId());
		
		return HcpAssembler.create(hcp).getHcpType();
	}
	
	return null;
}
 
Example 42
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 5 votes vote down vote up
private HcpCollection listHCPs(HcpFilter filter, String subClass)
{
	List hcps = listHCPList(filter,subClass,-1); //WDEV-11656
	
	//iterate through domainlist and use each subclasses respective assembler to convert and add to voCollHcps
	//Using arraylist so can sort it locally. Not sort won't work as collection is mixed type.
	ArrayList hcpList = new ArrayList();
	if(hcps != null)
	{			
		for(int i=0;i<hcps.size();i++)
		{
			Hcp hcp = (Hcp) hcps.get(i);
			if (Medic.class.isAssignableFrom(hcp.getClass())){
				hcpList.add(MedicVoAssembler.create((Medic)hcp));
			}
			
			else if (Therapist.class.isAssignableFrom(hcp.getClass()))
				hcpList.add(TherapistVoAssembler.create((Therapist)hcps.get(i)));
			else if (Nurse.class.isAssignableFrom(hcp.getClass()))
				hcpList.add(NurseVoAssembler.create((Nurse)hcps.get(i)));
			else
				hcpList.add(HcpAssembler.create((Hcp)hcps.get(i)));				
		}
	}
	Collections.sort(hcpList, new HcpAdminComparator(SortOrder.ASCENDING));		
	HcpCollection voCollHcps = new HcpCollection();
	for(int i=0; i < hcpList.size(); i++)
	{
		voCollHcps.add((ims.core.vo.Hcp)hcpList.get(i));
	}
	return voCollHcps;		
}
 
Example 43
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 5 votes vote down vote up
/**
* Creates a new HCP or updates if it already exists
*/
public ims.core.vo.Hcp saveHCP(ims.core.vo.Hcp hcp) throws StaleObjectException
{
	if (!hcp.isValidated())
	{
		throw new DomainRuntimeException("HCP VO has not been validated.");
	}
	DomainFactory factory = getDomainFactory();
	
	hcp.getName().setUppers();
	Hcp doHcp = null;
	
	if (hcp instanceof MedicVo)
	{
		doHcp = MedicVoAssembler.extractMedic(factory, (MedicVo)hcp);
	}
	else if (hcp instanceof TherapistVo)
	{
		doHcp = TherapistVoAssembler.extractTherapist(factory, (TherapistVo)hcp);					
	}
	else if (hcp instanceof NurseVo)
	{
		doHcp = NurseVoAssembler.extractNurse(factory, (NurseVo)hcp);		
	}
	else
	{
		doHcp = HcpAssembler.extractHcp(factory, hcp);		
	}

	factory.save(doHcp);
	hcp.setID_Hcp(doHcp.getId());
	return hcp;
}
 
Example 44
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.Hcp getHcpByExternalCode(TaxonomyType taxType, String codeVal)
{
	if (codeVal == null) return null;
	
	List hcpList = getDomHcpByExternalCode(taxType, codeVal);

	if (hcpList != null && hcpList.size() > 0)
	{
		Hcp hcp = (Hcp)hcpList.get(0);
		if (hcp instanceof Medic)
		{
			return MedicVoAssembler.create((Medic)hcp);
		}
		else if (hcp instanceof Therapist)
		{
			return TherapistVoAssembler.create((Therapist)hcp);
		}
		else if (hcp instanceof Nurse)
		{
			return NurseVoAssembler.create((Nurse)hcp);
		}
		else
		{
			return HcpAssembler.create((Hcp)hcpList.get(0));
		}
	}
	return null;
	
}
 
Example 45
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 46
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 47
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 5 votes vote down vote up
private Hcp getHcp(Integer hcpId) 
{
	DomainFactory factory = getDomainFactory();
	Hcp doHcp = (Hcp) factory.getDomainObject(Hcp.class, hcpId);

	return doHcp;		
}
 
Example 48
Project: AvoinApotti   File: HcpAdminImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.Hcp getHcp(HcpFilter filter) 
{
	DomainFactory factory = getDomainFactory();
	Hcp doHcp = (Hcp) factory.getDomainObject(Hcp.class, filter.getID_Hcp());

	if (Medic.class.isAssignableFrom(doHcp.getClass()))
		return MedicVoAssembler.create((Medic) doHcp);
	else if (doHcp instanceof Therapist)
		return TherapistVoAssembler.create((Therapist)doHcp);
	else if (doHcp instanceof Nurse)
		return NurseVoAssembler.create((Nurse) doHcp);
	
	return HcpAssembler.create(doHcp);		
}
 
Example 49
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.Hcp saveHcp(ims.core.vo.Hcp hcp) throws ims.domain.exceptions.StaleObjectException
{
	if (!hcp.isValidated())
	{
		throw new DomainRuntimeException("HCP VO has not been validated.");
	}
	DomainFactory factory = getDomainFactory();

	hcp.getName().setUppers();
	Hcp doHcp = null;

	if (hcp instanceof MedicVo)
	{
		doHcp = MedicVoAssembler.extractMedic(factory, (MedicVo) hcp);
	}
	else if (hcp instanceof TherapistVo)
	{
		doHcp = TherapistVoAssembler.extractTherapist(factory, (TherapistVo) hcp);
	}
	else if (hcp instanceof NurseVo)
	{
		doHcp = NurseVoAssembler.extractNurse(factory, (NurseVo) hcp);
	}
	else
	{
		doHcp = HcpAssembler.extractHcp(factory, hcp);
	}

	factory.save(doHcp);
	hcp.setID_Hcp(doHcp.getId());
	return hcp;
}
 
Example 50
Project: AvoinApotti   File: MyOrderImpl.java   Source Code and License 5 votes vote down vote up
/**
 * WDEV-13999
 * Function used to retrieve the Lead Consultant for a referral speciality
 */
public HcpLiteVo getLeadConsultantForReferral(CatsReferralRefVo referral)
{
	if (referral == null || !referral.getID_CatsReferralIsNotNull())
		return null;
	
	StringBuilder query = new StringBuilder();
	
	query.append("SELECT hcp FROM CatsReferral AS referral LEFT JOIN referral.referralDetails AS details LEFT JOIN details.service AS service, ");
	query.append(" SpecialtyLeadConsultant AS spec LEFT JOIN spec.leadConsultant AS hcp WHERE ");
	query.append(" spec.specialty.id = service.specialty.id AND referral.id = :REF_ID");
	
	return HcpLiteVoAssembler.create((Hcp) getDomainFactory().findFirst(query.toString(), "REF_ID", referral.getID_CatsReferral()));
}
 
Example 51
Project: AvoinApotti   File: MyOrderImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Function used to retrieve the HCP corresponding to a member of staff
 */
public HcpLiteVo getHCPbyMoS(MemberOfStaffRefVo memberOfStaff)
{
	if (memberOfStaff == null || !memberOfStaff.getID_MemberOfStaffIsNotNull())
		return null;
	
	StringBuilder query = new StringBuilder();
	
	query.append("select hcp from MemberOfStaff as mos left join mos.hcp as hcp");
	query.append(" where mos.id = :MOS_ID");
	
	return HcpLiteVoAssembler.create((Hcp) getDomainFactory().findFirst(query.toString(), "MOS_ID", memberOfStaff.getID_MemberOfStaff()));
}
 
Example 52
Project: AvoinApotti   File: PathologyDialogImpl.java   Source Code and License 5 votes vote down vote up
/**
 * WDEV-13321
 * Function used to reset the Allocated for review HCP
 */
public OrderInvestigationVo resetAllocatedReviewHCP(OrderInvestigationRefVo investigation) throws StaleObjectException
{
	if (investigation == null || !investigation.getID_OrderInvestigationIsNotNull())
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	OrderInvestigation domOrdInv = (OrderInvestigation) factory.getDomainObject(OrderInvestigation.class, investigation.getID_OrderInvestigation());
	
	
	if (domOrdInv == null)
		return null;
	
	if (domOrdInv.getAllocatedHCPforReview() == null)
		return OrderInvestigationVoAssembler.create(domOrdInv);
	
	HcpLiteVo hcpUser = (HcpLiteVo) getHcpLiteUser();
	ims.core.resource.people.domain.objects.Hcp domHcpUser = HcpLiteVoAssembler.extractHcp(factory, hcpUser);

	if (domOrdInv.getAllocatedHCPforReview().equals(domHcpUser))
	{
		domOrdInv.setAllocatedHCPforReview(null);
		domOrdInv.setAllocatedDateForReview(null);
		domOrdInv.setResultSortDate(domOrdInv.getRepDateTime());//http://jira/browse/WDEV-18025
		domOrdInv.setForReview(null);							// WDEV-18052
		domOrdInv.setReviewRequestedBy(null);					// WDEV-18052
	}
	
	return OrderInvestigationVoAssembler.create(domOrdInv);
}
 
Example 53
Project: AvoinApotti   File: BookTheatreSlotDetailDialogImpl.java   Source Code and License 5 votes vote down vote up
public HcpMinVo getHCPMin(HcpRefVo hcpRef)
{
	if (hcpRef == null || hcpRef.getID_Hcp()==null)
	{
		throw new CodingRuntimeException("Cannot get HCPMin for null ID");
	}
	
	DomainFactory factory = getDomainFactory();
	Hcp domHCP=(Hcp) factory.getDomainObject(Hcp.class, hcpRef.getID_Hcp());
	
	return HcpMinVoAssembler.create(domHCP);
}
 
Example 54
Project: AvoinApotti   File: BookTheatreSlotDetailDialogImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHCPLiteVo(HcpRefVo hcpRef)
{
	if (hcpRef == null || hcpRef.getID_Hcp()==null)
	{
		throw new CodingRuntimeException("Cannot get HCPMin for null ID");
	}
	
	DomainFactory factory = getDomainFactory();
	Hcp domHCP=(Hcp) factory.getDomainObject(Hcp.class, hcpRef.getID_Hcp());
	
	return HcpLiteVoAssembler.create(domHCP);
}
 
Example 55
Project: AvoinApotti   File: BaselineObsImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHCP(MemberOfStaffShortVo voMOS) 
{
	DomainFactory factory = getDomainFactory();
	String hql = " from Hcp h " +
	" where h.mos.id = :mosid";

	List hcpList = factory.find(hql,new String[]{"mosid"}, new Object[]{voMOS.getID_MemberOfStaff()});

	if (hcpList == null || hcpList.size() == 0)
		return null;

	return HcpLiteVoAssembler.create((Hcp)hcpList.get(0));
}
 
Example 56
Project: AvoinApotti   File: EDischargeHelper.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcp(HcpRefVo voRef) 
{
	if(voRef == null || voRef.getID_Hcp() == null)
		throw new CodingRuntimeException("HcpRefVo is null or id not provided for getHcp");
	
	return HcpLiteVoAssembler.create((Hcp)getDomainFactory().getDomainObject(voRef));
}
 
Example 57
Project: AvoinApotti   File: PlannedPerformedProcedureDialogImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcpLiteVo(HcpRefVo hcpRef) 
{
	if( hcpRef == null )
		return null;
	
	return HcpLiteVoAssembler.create((Hcp)getDomainFactory().getDomainObject(Hcp.class,hcpRef.getID_Hcp()));
}
 
Example 58
Project: AvoinApotti   File: EDischargeOpsProcsComponentImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcp(IMos iMos)
{
	if (iMos == null || iMos.getIMosId() == null)
		return null;
	
	String query = "from Hcp as hcp where hcp.isRIE is null and hcp.mos.id = " + iMos.getIMosId().toString();
	
	return HcpLiteVoAssembler.create((Hcp) getDomainFactory().findFirst(query));
}
 
Example 59
Project: AvoinApotti   File: ExtendedCarePlanClinicalNotesImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHCPLite(MemberOfStaffShortVo mos)
{
	if (mos == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	MosAdmin mosAdmin = (MosAdmin)getDomainImpl(MosAdminImpl.class);
	MemberOfStaffVo mosVo = mosAdmin.getMemberOfStaff(mos);
	
	Hcp doHcp = (Hcp) factory.getDomainObject(Hcp.class, mosVo.getHcp().getID_Hcp());
	return HcpLiteVoAssembler.create(doHcp);		
}
 
Example 60
Project: AvoinApotti   File: EDischargePatientReadyToLeaveSTHKComponentImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcp(HcpRefVo voRef) 
{
	if(voRef == null || voRef.getID_Hcp() == null)
		throw new CodingRuntimeException("HcpRefVo is null or id not provided for getHcp");
	
	return HcpLiteVoAssembler.create((Hcp)getDomainFactory().getDomainObject(voRef));
}