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

The following are top voted examples for showing how to use ims.core.resource.people.domain.objects.MemberOfStaff. 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: DemographicsImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPathwRTTStatus(int nationalCode) throws StaleObjectException //WDEV-18326
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();

	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);

	rttSTatusDO.setRTTStatus(rttStatusPoint);

	Object mos = getMosUser();
	MemberOfStaff doMos = null;

	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}

	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());

	return rttSTatusDO;
}
 
Example 2
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createNewStausBasedOnThePreviousStatus(PathwayRTTStatus doPreviousCurrentPathwayRttStatus)
{
	if(doPreviousCurrentPathwayRttStatus != null)
	{
   		PathwayRTTStatus rttStatusDO = new PathwayRTTStatus();
   		
   		rttStatusDO.setRTTStatus(doPreviousCurrentPathwayRttStatus.getRTTStatus());
   		
   		Object mos = getMosUser();
   		MemberOfStaff doMos = null;
   		
   		if(mos instanceof MemberOfStaffLiteVo)
   		{
   			doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
   		}
   		
   		rttStatusDO.setStatusBy(doMos);
   		rttStatusDO.setStatusDateTime(new java.util.Date());
   		rttStatusDO.setSetting("I");
   		
   		return rttStatusDO;
	}
	return null;
}
 
Example 3
Project: AvoinApotti   File: ClinicListImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 4
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MosOrgLocVoCollection listOrganisationsForMos(MemberOfStaffRefVo mos)
{
	DomainFactory factory = getDomainFactory();
	if (mos.getID_MemberOfStaff() == null)
	{
		return new MosOrgLocVoCollection();
	}
	
	MemberOfStaff mosBo = (MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, mos.getID_MemberOfStaff());
	factory.refresh(mosBo);
	if (mosBo == null)
	{
		return new MosOrgLocVoCollection();
	}
	Set hcpLocations = mosBo.getLocations();
	return this.listOrganisationsForLocations(hcpLocations);
}
 
Example 5
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo deactivateMos(MemberOfStaffShortVo mosVo) throws StaleObjectException
{
	if (mosVo.getID_MemberOfStaff() == null)
	{
		throw new DomainRuntimeException("Cannot Activate/Deactivate an MOS with NULL id!");
	}
	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosBo = MemberOfStaffShortVoAssembler.extractMemberOfStaff(getDomainFactory(), mosVo);
	mosBo.setIsActive(!(Boolean.TRUE.equals(mosBo.isIsActive())));
	
	if (mosBo.getHcp() != null)
	{
		mosBo.getHcp().setIsActive(mosBo.isIsActive());
	}
	

	factory.save(mosBo);

	return MemberOfStaffShortVoAssembler.create(mosBo);
}
 
Example 6
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo removeLinkedHcp(MemberOfStaffShortVo mosVo) throws StaleObjectException
{
	if (mosVo.getID_MemberOfStaff() == null)
	{
		throw new DomainRuntimeException("Cannot remove a HCP from a MOS with NULL id!");
	}
	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosBo = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, mosVo.getID_MemberOfStaff());
	if (mosBo.getHcp() == null)
	{
		return mosVo;
	}

	mosBo.getHcp().setIsActive(Boolean.FALSE);
	factory.save(mosBo.getHcp());
	mosBo.setHcp(null);
	mosBo.setStaffType(null);
	factory.save(mosBo);
	mosVo.setHcp(null);
	return mosVo;
}
 
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
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 9
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 10
Project: AvoinApotti   File: ReferralDetailsImpl.java   Source Code and License 6 votes vote down vote up
public void updateCatsReferralIsOnwardReferralFromTriage(CatsReferralRefVo catsReferral)
{
	if (catsReferral == null || catsReferral.getID_CatsReferral() == null)
		throw new CodingRuntimeException("catsReferral is null or id not provided in method updateCatsReferralIsOnwardReferralFromTriage");
	
	CatsReferral doCatsReferral = (CatsReferral)getDomainFactory().getDomainObject(catsReferral);
	
	//set current status to Referral ONWARDREFERRALREQUESTED and add to history
	CATSReferralStatus doStatus = new CATSReferralStatus();
	doStatus.setAuthoringUser((MemberOfStaff)getMosUser());
	doStatus.setReferralStatus(getDomLookup(ReferralApptStatus.ONWARDREFERRALREQUESTED));
	doStatus.setStatusDateTime(new DateTime().getJavaDate());
	
	doCatsReferral.getStatusHistory().add(doStatus);

	doCatsReferral.setIsOnwardReferralTriage(true);
	
	try
	{
		getDomainFactory().save(doCatsReferral);
	}
	catch (StaleObjectException e)
	{
		//unreachable code as get then update performed
	}
}
 
Example 11
Project: AvoinApotti   File: TheatreAdmissionImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPathwayRTTStatus(CatsReferral domCats)
{
	if(!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue())
		return null;
	
	if(domCats == null)
		return null;
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPoint(START_OF_FIRST_DEFINITIVE_TREATMENT);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	PathwayRTTStatus pathwayRTTStatus = new PathwayRTTStatus();
	pathwayRTTStatus.setRTTStatus(rttStatusPoint);
	pathwayRTTStatus.setStatusBy(doMos);
	pathwayRTTStatus.setStatusDateTime(new Date());
	
	if(domCats.getJourney() != null && domCats.getJourney().getCurrentClock() != null)
   	{
		domCats.getJourney().getCurrentClock().setCurrentRTTStatus(pathwayRTTStatus);
   			
   		if(domCats.getJourney().getCurrentClock().getRTTStatusHistory() == null)
   			domCats.getJourney().getCurrentClock().setRTTStatusHistory(new java.util.ArrayList());
   			
   		domCats.getJourney().getCurrentClock().getRTTStatusHistory().add(pathwayRTTStatus);
   	}
	
	return pathwayRTTStatus;
}
 
Example 12
Project: AvoinApotti   File: ClinicListImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 13
Project: AvoinApotti   File: ClinicListwithICPActionsImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 14
Project: openMAXIMS   File: PatientClinicalNotesforEvolveIngestionJobImpl.java   Source Code and License 6 votes vote down vote up
private MemberOfStaffVo getMOSForConfiguredJob(ClinicalNotesForEvolveTaskSettingsVo job)
{
	if ( (job == null)
		|| (job != null && job.getSystemInformation() == null)
		|| (job != null && job.getSystemInformation().getCreationUser() == null)
		||  (job != null && job.getSystemInformation().getCreationUser() == "") )
	{
		trace("MOSForConfiguredJob is null");
		return null;
	}
	
	String query = "select m1_1 from MemberOfStaff as m1_1 left join m1_1.appUser as a1_1 where a1_1.username = :userName";
	DomainFactoryBridge factory = getDomainFactory();
	List<?> results = factory.find(query, new String[] {"userName"}, new Object[] {job.getSystemInformation().getCreationUser()});
	if (results != null && results.size() >0)
		return MemberOfStaffVoAssembler.create((MemberOfStaff)results.get(0));
	else
		return null;
}
 
Example 15
Project: openMAXIMS   File: EDSupplementaryDischargeLetterJobImpl.java   Source Code and License 6 votes vote down vote up
private MemberOfStaffVo getMOSForConfiguredJob(EDSuppSummaryScheduleVo job)
{
	if ( job == null || job.getSystemInformation() == null	||  job.getSystemInformation().getCreationUser() == null || job.getSystemInformation().getCreationUser().length() == 0)
	{
		trace("Member of Staff for the configured job is null");
		return null;
	}
	
	String query = "select mos from MemberOfStaff as mos left join mos.appUser as usr where usr.username = :userName";
	DomainFactoryBridge factory = getDomainFactory();
	List<?> results = factory.find(query, new String[] {"userName"}, new Object[] {job.getSystemInformation().getCreationUser()});
	if (results != null && results.size() >0)
		return MemberOfStaffVoAssembler.create((MemberOfStaff)results.get(0));
	else
		return null;
}
 
Example 16
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo deactivateMos(MemberOfStaffShortVo mosVo) throws StaleObjectException
{
	if (mosVo.getID_MemberOfStaff() == null)
	{
		throw new DomainRuntimeException("Cannot Activate/Deactivate an MOS with NULL id!");
	}
	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosBo = MemberOfStaffShortVoAssembler.extractMemberOfStaff(getDomainFactory(), mosVo);
	mosBo.setIsActive(!(Boolean.TRUE.equals(mosBo.isIsActive())));
	
	if (mosBo.getHcp() != null)
	{
		mosBo.getHcp().setIsActive(mosBo.isIsActive());
	}
	

	factory.save(mosBo);

	return MemberOfStaffShortVoAssembler.create(mosBo);
}
 
Example 17
Project: openMAXIMS   File: EPrescribingImpl.java   Source Code and License 6 votes vote down vote up
/**
* Login to ICW returning a session id
*/

public String getPASUser(Integer mosId) throws DomainInterfaceException
{
	DomainFactory factory = getDomainFactory();		
	MemberOfStaff mosDo = (MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, mosId.intValue());
	if (mosDo==null)
		throw new DomainInterfaceException("User has no PAS mapping. Please add external mapping for PAS in User Administration.");
	MemberOfStaffMappingsLiteVo mVo = MemberOfStaffMappingsLiteVoAssembler.create(mosDo);

	for (int i = 0; i < mVo.getCodeMappings().size(); i++) {
		TaxonomyMap element = mVo.getCodeMappings().get(i);
		if (element.getTaxonomyName().equals(TaxonomyType.PAS))
			return element.getTaxonomyCode();			
	}
	
	return "";
}
 
Example 18
Project: openMAXIMS   File: DemographicsImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPathwRTTStatus(int nationalCode,boolean isInpatient, java.util.Date eventDateTime) ///WDEV-23292 throws StaleObjectException //WDEV-18326
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();

	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);

	rttSTatusDO.setRTTStatus(rttStatusPoint);
	if(isInpatient)						//WDEV-23292
		rttSTatusDO.setSetting("I");	//WDEV-23292


	Object mos = getMosUser();
	MemberOfStaff doMos = null;

	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}

	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(eventDateTime);

	return rttSTatusDO;
}
 
Example 19
Project: openMAXIMS   File: PDSDemographicsImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPathwRTTStatus(int nationalCode,boolean isInpatient, java.util.Date eventDateTime) throws StaleObjectException //WDEV-18326 //WDEV-//WDEV-23292
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();

	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);

	rttSTatusDO.setRTTStatus(rttStatusPoint);
	if(isInpatient)						//WDEV-23292
		rttSTatusDO.setSetting("I");	//WDEV-23292

	Object mos = getMosUser();
	MemberOfStaff doMos = null;

	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}

	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(eventDateTime);

	return rttSTatusDO;
}
 
Example 20
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo removeLinkedHcp(MemberOfStaffShortVo mosVo) throws StaleObjectException
{
	if (mosVo.getID_MemberOfStaff() == null)
	{
		throw new DomainRuntimeException("Cannot remove a HCP from a MOS with NULL id!");
	}
	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosBo = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, mosVo.getID_MemberOfStaff());
	if (mosBo.getHcp() == null)
	{
		return mosVo;
	}

	mosBo.getHcp().setIsActive(Boolean.FALSE);
	factory.save(mosBo.getHcp());
	mosBo.setHcp(null);
	mosBo.setStaffType(null);
	factory.save(mosBo);
	mosVo.setHcp(null);
	return mosVo;
}
 
Example 21
Project: openmaxims-linux   File: ClinicListwithICPActionsImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 22
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 23
Project: openMAXIMS   File: EpresDialogImpl.java   Source Code and License 6 votes vote down vote up
public String getPASUser(Integer mosId) throws DomainInterfaceException
{				
	DomainFactory factory = getDomainFactory();		
	MemberOfStaff mosDo = (MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, mosId.intValue());
	if (mosDo==null)
		throw new DomainInterfaceException("User has no PAS mapping. Please add external mapping for PAS in User Administration.");		
	MemberOfStaffMappingsLiteVo mVo = MemberOfStaffMappingsLiteVoAssembler.create(mosDo);

	for (int i = 0; i < mVo.getCodeMappings().size(); i++) {
		TaxonomyMap element = mVo.getCodeMappings().get(i);
		if (element.getTaxonomyName().equals(TaxonomyType.PAS))
			return element.getTaxonomyCode();			
	}
	
	return "";
}
 
Example 24
Project: openMAXIMS   File: AppointmentOutcomeDialogImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createNewRTTStatus(Integer nationalCode, Date eventDateTime)
{
	if (nationalCode == null)
		return null;
	
	PathwayRTTStatus status = new PathwayRTTStatus();
	status.setRTTStatus(getRTTStatusPoint(nationalCode));
	status.setStatusDateTime(eventDateTime);
	
	Object mos = getMosUser();
	if (mos instanceof MemberOfStaffLiteVo)
	{
		status.setStatusBy((MemberOfStaff) getDomainFactory().getDomainObject(MemberOfStaff.class, ((MemberOfStaffLiteVo) mos).getID_MemberOfStaff()));
	}

	return status;
}
 
Example 25
Project: openMAXIMS   File: ClinicListImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode, java.util.Date eventDateTime) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(eventDateTime);
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 26
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo deactivateMos(MemberOfStaffShortVo mosVo) throws StaleObjectException
	{
		if (mosVo.getID_MemberOfStaff() == null)
		{
			throw new DomainRuntimeException("Cannot Activate/Deactivate an MOS with NULL id!");
		}
		DomainFactory factory = getDomainFactory();
		MemberOfStaff mosBo = MemberOfStaffShortVoAssembler.extractMemberOfStaff(getDomainFactory(), mosVo);
		mosBo.setIsActive(!(Boolean.TRUE.equals(mosBo.isIsActive())));
		
		if (mosBo.getHcp() != null)
		{
			mosBo.getHcp().setIsActive(mosBo.isIsActive());
		}
		
	
		factory.save(mosBo);
	
		//WDEV-19576 MOS Master File HL7 message
		MemberOfStaffVo assembledMos = MemberOfStaffVoAssembler.create(mosBo);
		triggerMOSMasterFileEvent(assembledMos);
		
		return assembledMos;
		
//		return MemberOfStaffShortVoAssembler.create(mosBo);
	}
 
Example 27
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo removeLinkedHcp(MemberOfStaffShortVo mosVo) throws StaleObjectException
{
	if (mosVo.getID_MemberOfStaff() == null)
	{
		throw new DomainRuntimeException("Cannot remove a HCP from a MOS with NULL id!");
	}
	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosBo = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, mosVo.getID_MemberOfStaff());
	if (mosBo.getHcp() == null)
	{
		return mosVo;
	}

	mosBo.getHcp().setIsActive(Boolean.FALSE);
	factory.save(mosBo.getHcp());
	mosBo.setHcp(null);
	mosBo.setStaffType(null);
	factory.save(mosBo);
	mosVo.setHcp(null);
	return mosVo;
}
 
Example 28
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 29
Project: openmaxims-linux   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MemberOfStaffShortVo deactivateMos(MemberOfStaffShortVo mosVo) throws StaleObjectException
{
	if (mosVo.getID_MemberOfStaff() == null)
	{
		throw new DomainRuntimeException("Cannot Activate/Deactivate an MOS with NULL id!");
	}
	DomainFactory factory = getDomainFactory();
	MemberOfStaff mosBo = MemberOfStaffShortVoAssembler.extractMemberOfStaff(getDomainFactory(), mosVo);
	mosBo.setIsActive(!(Boolean.TRUE.equals(mosBo.isIsActive())));
	
	if (mosBo.getHcp() != null)
	{
		mosBo.getHcp().setIsActive(mosBo.isIsActive());
	}
	

	factory.save(mosBo);

	return MemberOfStaffShortVoAssembler.create(mosBo);
}
 
Example 30
Project: openMAXIMS   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 31
Project: openMAXIMS   File: ReferralTriageImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPathwayRTTStatus(int nationalCode, java.util.Date eventDateTime) throws DomainInterfaceException
{
	if(!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue())
		return null;

	RTTStatusPoint rttStatusPoint = getRTTStatusPoint(nationalCode);
	
	if (rttStatusPoint == null)
		throw new DomainInterfaceException("No RTT Status Point was found for National Code: " + nationalCode);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}

	PathwayRTTStatus pathwayRTTStatus = new PathwayRTTStatus();
	pathwayRTTStatus.setRTTStatus(rttStatusPoint);
	pathwayRTTStatus.setStatusBy(doMos);
	pathwayRTTStatus.setStatusDateTime(eventDateTime);

	return pathwayRTTStatus;
}
 
Example 32
Project: openMAXIMS   File: ElectiveListAddLaterDialogImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createNewRTTStatus(Integer nationalCode, Date eventDateTime)
{
	if (nationalCode == null)
		return null;
	
	PathwayRTTStatus status = new PathwayRTTStatus();
	status.setRTTStatus(getRTTStatusPoint(nationalCode));
	status.setStatusDateTime(eventDateTime);
	
	Object mos = getMosUser();
	if (mos instanceof MemberOfStaffLiteVo)
	{
		status.setStatusBy((MemberOfStaff) getDomainFactory().getDomainObject(MemberOfStaff.class, ((MemberOfStaffLiteVo) mos).getID_MemberOfStaff()));
	}

	return status;
}
 
Example 33
Project: openMAXIMS   File: ClinicListImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 34
Project: openmaxims-linux   File: ClinicListImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 35
Project: openMAXIMS   File: ClinicListImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode, java.util.Date eventDateTime) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(eventDateTime);
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 36
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 37
Project: openmaxims-linux   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 38
Project: openmaxims-linux   File: MosAdminImpl.java   Source Code and License 6 votes vote down vote up
public MosOrgLocVoCollection listOrganisationsForMos(MemberOfStaffRefVo mos)
{
	DomainFactory factory = getDomainFactory();
	if (mos.getID_MemberOfStaff() == null)
	{
		return new MosOrgLocVoCollection();
	}
	
	MemberOfStaff mosBo = (MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, mos.getID_MemberOfStaff());
	factory.refresh(mosBo);
	if (mosBo == null)
	{
		return new MosOrgLocVoCollection();
	}
	Set hcpLocations = mosBo.getLocations();
	return this.listOrganisationsForLocations(hcpLocations);
}
 
Example 39
Project: openmaxims-linux   File: BedInfoDialogImpl.java   Source Code and License 6 votes vote down vote up
private PathwayRTTStatus createNewStausBasedOnThePreviousStatus(PathwayRTTStatus doPreviousCurrentPathwayRttStatus)
{
	if(doPreviousCurrentPathwayRttStatus != null)
	{
   		PathwayRTTStatus rttStatusDO = new PathwayRTTStatus();
   		
   		rttStatusDO.setRTTStatus(doPreviousCurrentPathwayRttStatus.getRTTStatus());
   		
   		Object mos = getMosUser();
   		MemberOfStaff doMos = null;
   		
   		if(mos instanceof MemberOfStaffLiteVo)
   		{
   			doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
   		}
   		
   		rttStatusDO.setStatusBy(doMos);
   		rttStatusDO.setStatusDateTime(new java.util.Date());
   		rttStatusDO.setSetting("I");
   		
   		return rttStatusDO;
	}
	return null;
}
 
Example 40
Project: AvoinApotti   File: LocationTurningpointProvider.java   Source Code and License 5 votes vote down vote up
public boolean locationIsAllowed(ILocation location, IAppUser user) 
{
	if (location == null)
		return false;

	if (user == null)
		return false;

	if (user.getMosId() == null)
		return true;

	DomainFactory factory = getDomainFactory();		
	MemberOfStaff memberOfStaff = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, user.getMosId());		
	Location locationShort = (Location) factory.getDomainObject(Location.class, location.getID());
			
	// If the member of staff has no locations - return false
	if (memberOfStaff.getLocations() == null)
		return false;		
	
	Iterator it = ((Iterable<HcpLocation>) memberOfStaff.getLocations()).iterator(); 
	while (it.hasNext()) 
	{ 
		HcpLocation hcpLocation = (HcpLocation) it.next(); 
		
		// Skip to next location if the HCP location is null or HCP location doesn't have a location 
		if (hcpLocation == null)
			continue;

		if (hcpLocation.getLocation() == null)
			continue;

		// The locations match - return true
		if (hcpLocation.getLocation().equals(locationShort))
			return true;			 
	}
			
	// No matching location found - return false			
	return false;
}
 
Example 41
Project: AvoinApotti   File: LocationTurningpointProvider.java   Source Code and License 5 votes vote down vote up
private boolean locationIsAllowed(Location location, IAppUser user) 
{
	if (location == null)
		return false;

	if (user == null)
		return false;

	if (user.getMosId() == null)
		return true;

	DomainFactory factory = getDomainFactory();		
	MemberOfStaff memberOfStaff = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, user.getMosId());				
			
	// If the member of staff has no locations - return false
	if (memberOfStaff.getLocations() == null)
		return false;
			
	Iterator it = ((Iterable<HcpLocation>) memberOfStaff.getLocations()).iterator(); 
	while (it.hasNext()) 
	{ 
		HcpLocation hcpLocation = (HcpLocation) it.next(); 
		
		// Skip to next location if the HCP location is null or HCP location doesn't have a location 
		if (hcpLocation == null)
			continue;

		if (hcpLocation.getLocation() == null)
			continue;

		// The locations match - return true
		if (hcpLocation.getLocation().equals(location))
			return true;			 
	}
			
	// No matching location found - return false			
	return false;
}
 
Example 42
Project: AvoinApotti   File: LocationRefManProvider.java   Source Code and License 5 votes vote down vote up
public boolean locationIsAllowed(ILocation location, IAppUser user) 
{
	if (location == null)
		return false;

	if (user == null)
		return false;

	if (user.getMosId() == null)
		return true;

	DomainFactory factory = getDomainFactory();		
	MemberOfStaff memberOfStaff = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, user.getMosId());		
	Location locationShort = (Location) factory.getDomainObject(Location.class, location.getID());
			
	// If the member of staff has no locations - return false
	if (memberOfStaff.getLocations() == null)
		return false;		
	
	Iterator it = ((Iterable<HcpLocation>) memberOfStaff.getLocations()).iterator(); 
	while (it.hasNext()) 
	{ 
		HcpLocation hcpLocation = (HcpLocation) it.next(); 
		
		// Skip to next location if the HCP location is null or HCP location doesn't have a location 
		if (hcpLocation == null)
			continue;

		if (hcpLocation.getLocation() == null)
			continue;

		// The locations match - return true
		if (hcpLocation.getLocation().equals(locationShort))
			return true;			 
	}
			
	// No matching location found - return false			
	return false;
}
 
Example 43
Project: AvoinApotti   File: LocationRefManProvider.java   Source Code and License 5 votes vote down vote up
private boolean locationIsAllowed(Location location, IAppUser user) 
{
	if (location == null)
		return false;

	if (user == null)
		return false;

	if (user.getMosId() == null)
		return true;

	DomainFactory factory = getDomainFactory();		
	MemberOfStaff memberOfStaff = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, user.getMosId());				
			
	// If the member of staff has no locations - return false
	if (memberOfStaff.getLocations() == null)
		return false;
			
	Iterator it = ((Iterable<HcpLocation>) memberOfStaff.getLocations()).iterator(); 
	while (it.hasNext()) 
	{ 
		HcpLocation hcpLocation = (HcpLocation) it.next(); 
		
		// Skip to next location if the HCP location is null or HCP location doesn't have a location 
		if (hcpLocation == null)
			continue;

		if (hcpLocation.getLocation() == null)
			continue;

		// The locations match - return true
		if (hcpLocation.getLocation().equals(location))
			return true;			 
	}
			
	// No matching location found - return false			
	return false;
}
 
Example 44
Project: AvoinApotti   File: UploadDocumentImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffLiteVo getMoS(MemberOfStaffRefVo refVo) 
{
	if(refVo == null || 
			(refVo != null && refVo.getID_MemberOfStaff() == null))
				throw new DomainRuntimeException("Cannot get MemberOfStaffLiteVo for null MemberOfStaffRefVo");
	
	DomainFactory factory = getDomainFactory();		
	MemberOfStaff doMos = (MemberOfStaff) factory.getDomainObject(MemberOfStaff.class, refVo.getID_MemberOfStaff());
	return MemberOfStaffLiteVoAssembler.create(doMos);		
}
 
Example 45
Project: AvoinApotti   File: DocumentWorklistImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffLiteVo getLockedUser(MemberOfStaffRefVo mos) 
{
	if(mos == null || mos.getID_MemberOfStaff() == null)
		throw new CodingRuntimeException("Can not get Member of Staf on null Id.");
	
	return MemberOfStaffLiteVoAssembler.create((MemberOfStaff) getDomainFactory().getDomainObject(MemberOfStaff.class, mos.getID_MemberOfStaff()));
}
 
Example 46
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
private PathwayRTTStatus createPathwayRTTStatus(CatsReferral doCats)
{
	if(doCats == null)
		return null;
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPoint(START_OF_FIRST_DEFINITIVE_TREATMENT);
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	PathwayRTTStatus pathwayRTTStatus = new PathwayRTTStatus();
	pathwayRTTStatus.setRTTStatus(rttStatusPoint);
	pathwayRTTStatus.setStatusBy(doMos);
	pathwayRTTStatus.setStatusDateTime(new java.util.Date());
	
	if(doCats.getJourney() != null && doCats.getJourney().getCurrentClock() != null)
   	{
		doCats.getJourney().getCurrentClock().setCurrentRTTStatus(pathwayRTTStatus);
   			
   		if(doCats.getJourney().getCurrentClock().getRTTStatusHistory() == null)
   			doCats.getJourney().getCurrentClock().setRTTStatusHistory(new java.util.ArrayList());
   			
   		doCats.getJourney().getCurrentClock().getRTTStatusHistory().add(pathwayRTTStatus);
   	}
	
	return pathwayRTTStatus;
}
 
Example 47
Project: AvoinApotti   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
private PathwayRTTStatus createPathwayRTTStatus(CatsReferral domCats, boolean isDiagnostic) // WDEV-18617
{
	if(!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue())
		return null;
	
	if(domCats == null)
		return null;
	
	RTTStatusPoint rttStatusPoint =null;
	if (isDiagnostic)
		rttStatusPoint= getRTTStatusPoint(SUBSEQUENT_ACTIVITY);
	else
		rttStatusPoint= getRTTStatusPoint(START_OF_FIRST_DEFINITIVE_TREATMENT);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	PathwayRTTStatus pathwayRTTStatus = new PathwayRTTStatus();
	pathwayRTTStatus.setRTTStatus(rttStatusPoint);
	pathwayRTTStatus.setStatusBy(doMos);
	pathwayRTTStatus.setStatusDateTime(new java.util.Date());
	
	if(domCats.getJourney() != null && domCats.getJourney().getCurrentClock() != null)
   	{
		domCats.getJourney().getCurrentClock().setCurrentRTTStatus(pathwayRTTStatus);
   			
   		if(domCats.getJourney().getCurrentClock().getRTTStatusHistory() == null)
   			domCats.getJourney().getCurrentClock().setRTTStatusHistory(new java.util.ArrayList());
   			
   		domCats.getJourney().getCurrentClock().getRTTStatusHistory().add(pathwayRTTStatus);
   	}
	
	return pathwayRTTStatus;
}
 
Example 48
Project: AvoinApotti   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
public String getPasMappingFromConsultant(IMos mos)
{
	//WDEV-9946 undo of changes
	if (mos == null || mos.getIMosId() == null)
		throw new CodingRuntimeException("mos is null or id not provided in method getPasMappingFromConsultant");
	
	//WDEV-9946 undo of changes
	MemberOfStaff doMos = (MemberOfStaff) getDomainFactory().getDomainObject(MemberOfStaff.class, mos.getIMosId());
	return MemberOfStaffMappingsLiteVoAssembler.create(doMos).getPasCode();
}
 
Example 49
Project: AvoinApotti   File: PendingEmergencyAdmissionsImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.HcpLiteVoCollection listHCPs(String hcp)
{
	DomainFactory factory = getDomainFactory();
	IMSCriteria imsc=new IMSCriteria(MemberOfStaff.class,factory);
	imsc.isNotNull("hcp");
	List hcps = imsc.find();
	if (hcps!=null)
		return HcpLiteVoAssembler.createHcpLiteVoCollectionFromHcp(hcps);
	return null;
}
 
Example 50
Project: AvoinApotti   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public void addActionStatus(PatientICPActionRefVo actionRef, ICPActionStatus status, Boolean hasCountersigningRight) throws DomainInterfaceException, StaleObjectException
{
	if(actionRef == null || actionRef.getID_PatientICPAction() == null)
		throw new CodingRuntimeException("PatientICPActionRefVo is null or has a null ID !");
	
	DomainFactory factory = getDomainFactory();
	
	PatientICPAction actionBo = (PatientICPAction) factory.loadDomainObject(PatientICPAction.class, actionRef.getID_PatientICPAction());
	
	PatientICPActionFullVo actionVo = PatientICPActionFullVoAssembler.create(actionBo);
	
	PatientICPActionStatusVo actionStatusVo = new PatientICPActionStatusVo();
	
	actionStatusVo.setStatusDate(new DateTime());
	actionStatusVo.setChangedBy(getSession().getUser() != null ? MemberOfStaffLiteVoAssembler.create((MemberOfStaff) getDomainFactory().getDomainObject(MemberOfStaff.class, getSession().getUser().getMosId())) : null);
	actionStatusVo.setStatus(status);
	
	actionVo.setCurrentStatus(actionStatusVo);
	actionVo.getStatusHistory().add(actionStatusVo);
	
	
	if (ICPActionStatus.MET.equals(status) || ICPActionStatus.NOT_MET.equals(status))
	{
		if (!Boolean.TRUE.equals(hasCountersigningRight) && Boolean.TRUE.equals(actionVo.getAction().getRequiresCounterSignature()))
		{
			actionVo.setRequiresCounterSigning(Boolean.TRUE);
		}
	}
	
	factory.save(PatientICPActionFullVoAssembler.extractPatientICPAction(factory, actionVo));
}
 
Example 51
Project: AvoinApotti   File: AppointmentOutcomeDialogImpl.java   Source Code and License 5 votes vote down vote up
private void createPathwayRTTStatus(RTTStatusPointVo rttStatusPointVo, CatsReferral doCats)
{
	if(doCats == null || rttStatusPointVo == null)
		return;
	
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	PathwayRTTStatus pathwayRTTStatus = new PathwayRTTStatus();
	pathwayRTTStatus.setRTTStatus(RTTStatusPointVoAssembler.extractRTTStatusPoint(getDomainFactory(), rttStatusPointVo));
	pathwayRTTStatus.setStatusBy(doMos);
	pathwayRTTStatus.setStatusDateTime(new Date());
	
	doCats.setCurrentRTTStatus(pathwayRTTStatus);
	if(doCats.getJourney() != null && doCats.getJourney().getCurrentClock() != null)
   	{
		doCats.getJourney().getCurrentClock().setCurrentRTTStatus(pathwayRTTStatus);
   			
   		if(doCats.getJourney().getCurrentClock().getRTTStatusHistory() == null)
   			doCats.getJourney().getCurrentClock().setRTTStatusHistory(new java.util.ArrayList());
   			
   		doCats.getJourney().getCurrentClock().getRTTStatusHistory().add(pathwayRTTStatus);
   	}
}
 
Example 52
Project: AvoinApotti   File: UserProvider.java   Source Code and License 5 votes vote down vote up
public String getUserRealName(IAppUser user)
{
	if (user.getMosId() != null)
	{
		MemberOfStaff mos = (MemberOfStaff)getDomainFactory().getDomainObject(MemberOfStaff.class, user.getMosId());
		return mos.getName().toString();			
	}
	else
		return null;
}
 
Example 53
Project: AvoinApotti   File: ExternalAuthUserProvider.java   Source Code and License 5 votes vote down vote up
public String getUserRealName(IAppUser user)
{
	if (user.getMosId() != null)
	{
		MemberOfStaff mos = (MemberOfStaff)getDomainFactory().getDomainObject(MemberOfStaff.class, user.getMosId());
		return mos.getName().toString();			
	}
	else
		return null;
}
 
Example 54
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffShortVoCollection listNCHDs()
{
	DomainFactory factory = getDomainFactory();
	List lstMedics =  factory.find("from Medic m where m.isActive = :bActive and m.grade != :medicGrade", new String[]{"medicGrade", "bActive"}, new Object[]{getDomLookup(MedicGrade.CONS), Boolean.TRUE});

	MemberOfStaffShortVoCollection voCollMos = new MemberOfStaffShortVoCollection();
	for (Iterator iter = lstMedics.iterator(); iter.hasNext();)
	{
		MemberOfStaff doMos = ((Medic) iter.next()).getMos();
		voCollMos.add(MemberOfStaffShortVoAssembler.create(doMos));
	}
	return voCollMos;		
}
 
Example 55
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public HcpLiteVo getHcpLiteByTaxonomyType(String extCode, TaxonomyType taxType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extCode, taxType);
	if (domMos == null)
		return null;
	else
	{
		return HcpLiteVoAssembler.create(domMos.getHcp());
	}
}
 
Example 56
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public MedicRefVo getMedicRefByTaxonomyType(String extCode,TaxonomyType taxType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extCode, taxType);
	if (domMos == null)
		return null;
	else
	{
		return new MedicRefVo(domMos.getHcp().getId(),domMos.getHcp().getVersion()); 
	}
}
 
Example 57
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 58
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public HcpMinVo getHcpMinByTaxonomyType(String extCode, TaxonomyType taxType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extCode, taxType);
	if (domMos == null)
		return null;
	else
	{
		return HcpMinVoAssembler.create(domMos.getHcp());
	}
}
 
Example 59
Project: AvoinApotti   File: BaselineObsImpl.java   Source Code and License 5 votes vote down vote up
public MemberOfStaffVo getMos(HcpLiteVo voHCP) 
{
	DomainFactory factory = getDomainFactory();
	String hql = " from MemberOfStaff m " +
	" where m.hcp.id = :hcpid";

	List mosList = factory.find(hql,new String[]{"hcpid"}, new Object[]{voHCP.getID_Hcp()});

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

	return MemberOfStaffVoAssembler.create((MemberOfStaff)mosList.get(0));
}
 
Example 60
Project: AvoinApotti   File: DayCaseAdmissionDialogImpl.java   Source Code and License 5 votes vote down vote up
private PathwayRTTStatus createPathwayRTTStatus(CatsReferral domCats)
{
	if(!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue())
		return null;
	
	if(domCats == null)
		return null;
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPoint(START_OF_FIRST_DEFINITIVE_TREATMENT);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	PathwayRTTStatus pathwayRTTStatus = new PathwayRTTStatus();
	pathwayRTTStatus.setRTTStatus(rttStatusPoint);
	pathwayRTTStatus.setStatusBy(doMos);
	pathwayRTTStatus.setStatusDateTime(new java.util.Date());
	
	if(domCats.getJourney() != null && domCats.getJourney().getCurrentClock() != null)
   	{
		domCats.getJourney().getCurrentClock().setCurrentRTTStatus(pathwayRTTStatus);
   			
   		if(domCats.getJourney().getCurrentClock().getRTTStatusHistory() == null)
   			domCats.getJourney().getCurrentClock().setRTTStatusHistory(new java.util.ArrayList());
   			
   		domCats.getJourney().getCurrentClock().getRTTStatusHistory().add(pathwayRTTStatus);
   	}
	
	return pathwayRTTStatus;
}