Java Code Examples for ims.core.vo.domain.BedSpaceStateLiteVoAssembler

The following are top voted examples for showing how to use ims.core.vo.domain.BedSpaceStateLiteVoAssembler. 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: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 7 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceStateByInpatientEpisode(InpatientEpisodeRefVo inpat)
{
	if (inpat == null || inpat.getID_InpatientEpisode() == null)
		throw new CodingRuntimeException("inpat is null or id not provided in method getBedSpaceStateByInpatientEpisode");
	
	String hql = "from BedSpaceState as bed where bed.inpatientEpisode.id = " + inpat.getID_InpatientEpisode();
	List lstBeds = getDomainFactory().find(hql);
	if(lstBeds != null && lstBeds.size() == 1)
		return BedSpaceStateLiteVoAssembler.create((BedSpaceState) lstBeds.get(0));
	
	return null;
}
 
Example 2
Project: AvoinApotti   File: WardBayConfigDialogImpl.java   Source Code and License 6 votes vote down vote up
private BedSpaceStateLiteVo getBedSpaceState(BedSpace bed) 
{
	if (bed == null || bed.getId() == null)
		return null;
	
	String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getId();
	List bedState = getDomainFactory().find(hql);
	
	BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);
	
	if (voColl != null &&
			voColl.size() > 0)
		return voColl.get(0);		
	
	return null;
}
 
Example 3
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 6 votes vote down vote up
public void saveInternalTransfer(InpatientEpisodeLiteVo inpatEpis, BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
	if (bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveInternalTransfer");
	if (inpatEpis == null)
		throw new CodingRuntimeException("inpatEpis is null in method saveInternalTransfer");
	
	BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
	InpatientEpisode doInpatEpis = InpatientEpisodeLiteVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatEpis);
	doInpatEpis.getBed().getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.AVAILABLE));
	doInpatEpis.getBed().setInpatientEpisode(null);
	getDomainFactory().save(doInpatEpis);
	
	doBedSpaceState.setInpatientEpisode(doInpatEpis);
	doBedSpaceState.getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.OCCUPIED));
	doInpatEpis.setBed(doBedSpaceState);
	
	getDomainFactory().save(doInpatEpis);
}
 
Example 4
Project: openMAXIMS   File: WardBayConfigDialogImpl.java   Source Code and License 6 votes vote down vote up
private BedSpaceStateLiteVo getBedSpaceState(BedSpace bed) 
{
	if (bed == null || bed.getId() == null)
		return null;
	
	String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getId();
	List<?> bedState = getDomainFactory().find(hql);
	
	BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);
	
	if (voColl != null &&
			voColl.size() > 0)
		return voColl.get(0);		
	
	return null;
}
 
Example 5
Project: openMAXIMS   File: AssignBedToHomeLeaveInpatientImpl.java   Source Code and License 6 votes vote down vote up
public ims.core.vo.BedSpaceStateLiteVoCollection listAvailableBedSpaces(ims.core.resource.place.vo.LocationRefVo wardRef)
{
	if (wardRef == null)
		return null;
	
	StringBuilder hql = new StringBuilder();
	DomainFactory factory = getDomainFactory();
	hql.append("select bedspacest from BedSpaceState as bedspacest left join bedspacest.ward as ward left join bedspacest.bay as bay left join bedspacest.currentBedStatus as currentStatus left join currentStatus.bedStatus as status where ward.id = :WARD_ID and status.id = :AVAILABLE_BED_STATUS and bay.isActive = :IS_ACTIVE AND bay.id in (select bayloc.id from BayConfig bconfig left join bconfig.bay as bayloc left join bconfig.floorBedSpaceLayout as flayout left join flayout.status as stat where stat.id = :STATUS_ID) ");
	
	List<?> recordList = factory.find(hql.toString(), new String[]{"WARD_ID", "AVAILABLE_BED_STATUS", "IS_ACTIVE", "STATUS_ID"}, new Object[]{wardRef.getID_Location(),BedStatus.AVAILABLE.getID(), Boolean.TRUE,PreActiveActiveInactiveStatus.ACTIVE.getID()});
	
	if (recordList == null || recordList.isEmpty())
		return null;
	
	return BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(recordList);
}
 
Example 6
Project: openMAXIMS   File: WardBayConfigDialogImpl.java   Source Code and License 6 votes vote down vote up
private BedSpaceStateLiteVo getBedSpaceState(BedSpace bed) 
{
	if (bed == null || bed.getId() == null)
		return null;
	
	String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getId();
	List bedState = getDomainFactory().find(hql);
	
	BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);
	
	if (voColl != null &&
			voColl.size() > 0)
		return voColl.get(0);		
	
	return null;
}
 
Example 7
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 6 votes vote down vote up
public void saveInternalTransfer(InpatientEpisodeLiteVo inpatEpis, BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
	if (bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveInternalTransfer");
	if (inpatEpis == null)
		throw new CodingRuntimeException("inpatEpis is null in method saveInternalTransfer");
	
	BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
	InpatientEpisode doInpatEpis = InpatientEpisodeLiteVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatEpis);
	doInpatEpis.getBed().getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.AVAILABLE));
	doInpatEpis.getBed().setInpatientEpisode(null);
	getDomainFactory().save(doInpatEpis);
	
	doBedSpaceState.setInpatientEpisode(doInpatEpis);
	doBedSpaceState.getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.OCCUPIED));
	doInpatEpis.setBed(doBedSpaceState);
	
	getDomainFactory().save(doInpatEpis);
}
 
Example 8
Project: openmaxims-linux   File: WardBayConfigDialogImpl.java   Source Code and License 6 votes vote down vote up
private BedSpaceStateLiteVo getBedSpaceState(BedSpace bed) 
{
	if (bed == null || bed.getId() == null)
		return null;
	
	String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getId();
	List bedState = getDomainFactory().find(hql);
	
	BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);
	
	if (voColl != null &&
			voColl.size() > 0)
		return voColl.get(0);		
	
	return null;
}
 
Example 9
Project: openmaxims-linux   File: BedInfoDialogImpl.java   Source Code and License 6 votes vote down vote up
public void saveInternalTransfer(InpatientEpisodeLiteVo inpatEpis, BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
	if (bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveInternalTransfer");
	if (inpatEpis == null)
		throw new CodingRuntimeException("inpatEpis is null in method saveInternalTransfer");
	
	BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
	InpatientEpisode doInpatEpis = InpatientEpisodeLiteVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatEpis);
	doInpatEpis.getBed().getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.AVAILABLE));
	doInpatEpis.getBed().setInpatientEpisode(null);
	getDomainFactory().save(doInpatEpis);
	
	doBedSpaceState.setInpatientEpisode(doInpatEpis);
	doBedSpaceState.getCurrentBedStatus().setBedStatus(getDomLookup(BedStatus.OCCUPIED));
	doInpatEpis.setBed(doBedSpaceState);
	
	getDomainFactory().save(doInpatEpis);
}
 
Example 10
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo saveCloseBed(BedSpaceStateLiteVo bedSpaceState, String user, ReasonForBedClosure reason, DateTime estReOpen) throws StaleObjectException
{
	if(bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveCloseBed");
	
	BedSpaceState doBedSpace = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
	doBedSpace.getCurrentBedStatus().setEstReopeningDateTime(estReOpen != null ? estReOpen.getJavaDate() : null);
	doBedSpace.getCurrentBedStatus().setReasonForClosure(getDomLookup(reason));
	doBedSpace.getCurrentBedStatus().getSystemInformation().setCreationUser(user);
	
	getDomainFactory().save(doBedSpace);
	return BedSpaceStateLiteVoAssembler.create(doBedSpace);
}
 
Example 11
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public void saveReOpenOrAssignBed(BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
	if(bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveReOpenOrAssignBed");
	
	//WDEV-8507
	bedSpaceState.setInpatientEpisode(null);
	
	getDomainFactory().save(BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState));	
}
 
Example 12
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceStateByInpatientEpisode(InpatientEpisodeRefVo inpat)
{
	if (inpat == null || inpat.getID_InpatientEpisode() == null)
		throw new CodingRuntimeException("inpat is null or id not provided in method getBedSpaceStateByInpatientEpisode");
	
	String hql = "from BedSpaceState as bed where bed.inpatientEpisode.id = " + inpat.getID_InpatientEpisode();
	List lstBeds = getDomainFactory().find(hql);
	if(lstBeds != null && lstBeds.size() == 1)
		return BedSpaceStateLiteVoAssembler.create((BedSpaceState) lstBeds.get(0));
	
	return null;
}
 
Example 13
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceStateStatusByBedId(BedSpaceStateRefVo bedSpaceRef)
{
	if(bedSpaceRef == null || bedSpaceRef.getID_BedSpaceState() == null)
		throw new CodingRuntimeException("Cannot get BedSpaceState on null Id.");
	
	return BedSpaceStateLiteVoAssembler.create(	(BedSpaceState)		getDomainFactory().getDomainObject(BedSpaceState.class, bedSpaceRef.getID_BedSpaceState()));
}
 
Example 14
Project: AvoinApotti   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateRefVo bedRef)
{
	if(bedRef == null || bedRef.getID_BedSpaceState() == null)
		throw new CodingRuntimeException("Cannot get BedSpaceState on null Id.");
	
	return BedSpaceStateLiteVoAssembler.create(	(BedSpaceState)	getDomainFactory().getDomainObject(BedSpaceState.class, bedRef.getID_BedSpaceState()));
}
 
Example 15
Project: AvoinApotti   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceRefVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");

	DomainFactory factory = getDomainFactory();
	BedSpaceState domBed = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bed.getID_BedSpace());
	return BedSpaceStateLiteVoAssembler.create(domBed);
}
 
Example 16
Project: AvoinApotti   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateLiteVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");

	DomainFactory factory = getDomainFactory();
	BedSpaceState domBed = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bed.getID_BedSpaceState());
	return BedSpaceStateLiteVoAssembler.create(domBed);
}
 
Example 17
Project: AvoinApotti   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo saveBedSpaceState(BedSpaceStateLiteVo voBSS) throws DomainInterfaceException, StaleObjectException 
{
	if (!voBSS.isValidated())
		throw new CodingRuntimeException("BedSpaceStateLiteVo Record has not been validated");
	if(voBSS == null)
		throw new CodingRuntimeException("Cannot save null BedSpaceStateLiteVo");
	
	DomainFactory factory = getDomainFactory();
	
	BedSpaceState doBSS = BedSpaceStateLiteVoAssembler.extractBedSpaceState(factory, voBSS);
	factory.save(doBSS);
	return (BedSpaceStateLiteVoAssembler.create(doBSS));		
}
 
Example 18
Project: AvoinApotti   File: WardViewImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceRefVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");
	
	String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getID_BedSpace();
	List bedState = getDomainFactory().find(hql);
	
	//WDEV-11039
	boolean hasAlerts = false;
	if(bedState != null && bedState.size() > 0)
	{	
		BedSpaceState doBed = (BedSpaceState)bedState.get(0);
		if(doBed.getInpatientEpisode() != null && doBed.getInpatientEpisode().getPasEvent() != null && doBed.getInpatientEpisode().getPasEvent().getPatient() != null && doBed.getInpatientEpisode().getPasEvent().getPatient().getPatientAlerts() != null)
			if(doBed.getInpatientEpisode().getPasEvent().getPatient().getPatientAlerts().size() > 0 && isOneActive(doBed.getInpatientEpisode().getPasEvent().getPatient().getPatientAlerts(), true))
				hasAlerts = true;
	}
	
	BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);
	
	if (voColl != null && voColl.size() > 0)
	{
		if(voColl.get(0).getInpatientEpisodeIsNotNull() && voColl.get(0).getInpatientEpisode().getPasEventIsNotNull() && voColl.get(0).getInpatientEpisode().getPasEvent().getPatientIsNotNull())
			voColl.get(0).getInpatientEpisode().getPasEvent().getPatient().setHasAlerts(hasAlerts);
		
		return voColl.get(0);		
	}
	return null;
}
 
Example 19
Project: openMAXIMS   File: WardViewPatientListImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getSelectedBedSpaceState(BedSpaceStateRefVo bedSpaceRef)
{
	DomainFactory factory = getDomainFactory();
	 BedSpaceState doBedSpaceState = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bedSpaceRef.getID_BedSpaceState());
	 
	return doBedSpaceState != null ? BedSpaceStateLiteVoAssembler.create(doBedSpaceState) : null;
}
 
Example 20
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo saveCloseBed(BedSpaceStateLiteVo bedSpaceState, String user, ReasonForBedClosure reason, DateTime estReOpen) throws StaleObjectException
{
	if(bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveCloseBed");
	
	BedSpaceState doBedSpace = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
	doBedSpace.getCurrentBedStatus().setEstReopeningDateTime(estReOpen != null ? estReOpen.getJavaDate() : null);
	doBedSpace.getCurrentBedStatus().setReasonForClosure(getDomLookup(reason));
	doBedSpace.getCurrentBedStatus().getSystemInformation().setCreationUser(user);
	
	getDomainFactory().save(doBedSpace);
	return BedSpaceStateLiteVoAssembler.create(doBedSpace);
}
 
Example 21
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public void saveReOpenOrAssignBed(BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
	if(bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveReOpenOrAssignBed");
	
	//WDEV-8507
	bedSpaceState.setInpatientEpisode(null);
	
	getDomainFactory().save(BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState));	
}
 
Example 22
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceStateByInpatientEpisode(InpatientEpisodeRefVo inpat)
{
	if (inpat == null || inpat.getID_InpatientEpisode() == null)
		throw new CodingRuntimeException("inpat is null or id not provided in method getBedSpaceStateByInpatientEpisode");
	
	String hql = "from BedSpaceState as bed where bed.inpatientEpisode.id = " + inpat.getID_InpatientEpisode();
	List lstBeds = getDomainFactory().find(hql);
	if(lstBeds != null && lstBeds.size() == 1)
		return BedSpaceStateLiteVoAssembler.create((BedSpaceState) lstBeds.get(0));
	
	return null;
}
 
Example 23
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceStateStatusByBedId(BedSpaceStateRefVo bedSpaceRef)
{
	if(bedSpaceRef == null || bedSpaceRef.getID_BedSpaceState() == null)
		throw new CodingRuntimeException("Cannot get BedSpaceState on null Id.");
	
	return BedSpaceStateLiteVoAssembler.create(	(BedSpaceState)		getDomainFactory().getDomainObject(BedSpaceState.class, bedSpaceRef.getID_BedSpaceState()));
}
 
Example 24
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateRefVo bedSpaceState)
{
	if (bedSpaceState == null || bedSpaceState.getID_BedSpaceState() == null)
		return null;
	
	return BedSpaceStateLiteVoAssembler.create((BedSpaceState) getDomainFactory().getDomainObject(BedSpaceState.class, bedSpaceState.getID_BedSpaceState()));
}
 
Example 25
Project: openMAXIMS   File: WardDataViewImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateRefVo bedSpaceState)
{
	if (bedSpaceState == null || bedSpaceState.getID_BedSpaceState() == null)
		return null;

	return BedSpaceStateLiteVoAssembler.create((BedSpaceState) getDomainFactory().getDomainObject(BedSpaceState.class, bedSpaceState.getID_BedSpaceState()));
}
 
Example 26
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateRefVo bedRef)
{
	if(bedRef == null || bedRef.getID_BedSpaceState() == null)
		throw new CodingRuntimeException("Cannot get BedSpaceState on null Id.");

	return BedSpaceStateLiteVoAssembler.create(	(BedSpaceState)	getDomainFactory().getDomainObject(BedSpaceState.class, bedRef.getID_BedSpaceState()));
}
 
Example 27
Project: openMAXIMS   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceRefVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");

	DomainFactory factory = getDomainFactory();
	BedSpaceState domBed = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bed.getID_BedSpace());
	return BedSpaceStateLiteVoAssembler.create(domBed);
}
 
Example 28
Project: openMAXIMS   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateLiteVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");

	DomainFactory factory = getDomainFactory();
	BedSpaceState domBed = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bed.getID_BedSpaceState());
	return BedSpaceStateLiteVoAssembler.create(domBed);
}
 
Example 29
Project: openMAXIMS   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo saveBedSpaceState(BedSpaceStateLiteVo voBSS) throws DomainInterfaceException, StaleObjectException 
{
	if (!voBSS.isValidated())
		throw new CodingRuntimeException("BedSpaceStateLiteVo Record has not been validated");
	if(voBSS == null)
		throw new CodingRuntimeException("Cannot save null BedSpaceStateLiteVo");
	
	DomainFactory factory = getDomainFactory();
	
	BedSpaceState doBSS = BedSpaceStateLiteVoAssembler.extractBedSpaceState(factory, voBSS);
	factory.save(doBSS);
	return (BedSpaceStateLiteVoAssembler.create(doBSS));		
}
 
Example 30
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo saveCloseBed(BedSpaceStateLiteVo bedSpaceState, String user, ReasonForBedClosure reason, DateTime estReOpen) throws StaleObjectException
{
	if(bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveCloseBed");
	
	BedSpaceState doBedSpace = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
	doBedSpace.getCurrentBedStatus().setEstReopeningDateTime(estReOpen != null ? estReOpen.getJavaDate() : null);
	doBedSpace.getCurrentBedStatus().setReasonForClosure(getDomLookup(reason));
	doBedSpace.getCurrentBedStatus().getSystemInformation().setCreationUser(user);
	
	getDomainFactory().save(doBedSpace);
	return BedSpaceStateLiteVoAssembler.create(doBedSpace);
}
 
Example 31
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public void saveReOpenOrAssignBed(BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
	if(bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveReOpenOrAssignBed");
	
	//WDEV-8507
	bedSpaceState.setInpatientEpisode(null);
	
	getDomainFactory().save(BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState));	
}
 
Example 32
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceStateStatusByBedId(BedSpaceStateRefVo bedSpaceRef)
{
	if(bedSpaceRef == null || bedSpaceRef.getID_BedSpaceState() == null)
		throw new CodingRuntimeException("Cannot get BedSpaceState on null Id.");
	
	return BedSpaceStateLiteVoAssembler.create(	(BedSpaceState)		getDomainFactory().getDomainObject(BedSpaceState.class, bedSpaceRef.getID_BedSpaceState()));
}
 
Example 33
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateRefVo bedRef)
{
	if(bedRef == null || bedRef.getID_BedSpaceState() == null)
		throw new CodingRuntimeException("Cannot get BedSpaceState on null Id.");
	
	return BedSpaceStateLiteVoAssembler.create(	(BedSpaceState)	getDomainFactory().getDomainObject(BedSpaceState.class, bedRef.getID_BedSpaceState()));
}
 
Example 34
Project: openMAXIMS   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceRefVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");

	DomainFactory factory = getDomainFactory();
	BedSpaceState domBed = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bed.getID_BedSpace());
	return BedSpaceStateLiteVoAssembler.create(domBed);
}
 
Example 35
Project: openMAXIMS   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceStateLiteVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");

	DomainFactory factory = getDomainFactory();
	BedSpaceState domBed = (BedSpaceState) factory.getDomainObject(BedSpaceState.class, bed.getID_BedSpaceState());
	return BedSpaceStateLiteVoAssembler.create(domBed);
}
 
Example 36
Project: openMAXIMS   File: AvailableBedsImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo saveBedSpaceState(BedSpaceStateLiteVo voBSS) throws DomainInterfaceException, StaleObjectException 
{
	if (!voBSS.isValidated())
		throw new CodingRuntimeException("BedSpaceStateLiteVo Record has not been validated");
	if(voBSS == null)
		throw new CodingRuntimeException("Cannot save null BedSpaceStateLiteVo");
	
	DomainFactory factory = getDomainFactory();
	
	BedSpaceState doBSS = BedSpaceStateLiteVoAssembler.extractBedSpaceState(factory, voBSS);
	factory.save(doBSS);
	return (BedSpaceStateLiteVoAssembler.create(doBSS));		
}
 
Example 37
Project: openMAXIMS   File: WardViewImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceRefVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");
	
	String hql = "select bs from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getID_BedSpace();
	List bedState = getDomainFactory().find(hql);
	
	//WDEV-11039
	boolean hasAlerts = false;
	if(bedState != null && bedState.size() > 0)
	{	
		BedSpaceState doBed = (BedSpaceState)bedState.get(0);
		if(doBed.getInpatientEpisode() != null && doBed.getInpatientEpisode().getPasEvent() != null && doBed.getInpatientEpisode().getPasEvent().getPatient() != null && doBed.getInpatientEpisode().getPasEvent().getPatient().getPatientAlerts() != null)
			if(doBed.getInpatientEpisode().getPasEvent().getPatient().getPatientAlerts().size() > 0 && isOneActive(doBed.getInpatientEpisode().getPasEvent().getPatient().getPatientAlerts(), true))
				hasAlerts = true;
	}
	
	BedSpaceStateLiteVoCollection voColl = BedSpaceStateLiteVoAssembler.createBedSpaceStateLiteVoCollectionFromBedSpaceState(bedState);
	
	if (voColl != null && voColl.size() > 0)
	{
		if(voColl.get(0).getInpatientEpisodeIsNotNull() && voColl.get(0).getInpatientEpisode().getPasEventIsNotNull() && voColl.get(0).getInpatientEpisode().getPasEvent().getPatientIsNotNull())
			voColl.get(0).getInpatientEpisode().getPasEvent().getPatient().setHasAlerts(hasAlerts);
		
		return voColl.get(0);		
	}
	return null;
}
 
Example 38
Project: openmaxims-linux   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo saveCloseBed(BedSpaceStateLiteVo bedSpaceState, String user, ReasonForBedClosure reason, DateTime estReOpen) throws StaleObjectException
{
	if(bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveCloseBed");
	
	BedSpaceState doBedSpace = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState);
	doBedSpace.getCurrentBedStatus().setEstReopeningDateTime(estReOpen != null ? estReOpen.getJavaDate() : null);
	doBedSpace.getCurrentBedStatus().setReasonForClosure(getDomLookup(reason));
	doBedSpace.getCurrentBedStatus().getSystemInformation().setCreationUser(user);
	
	getDomainFactory().save(doBedSpace);
	return BedSpaceStateLiteVoAssembler.create(doBedSpace);
}
 
Example 39
Project: openmaxims-linux   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public void saveReOpenOrAssignBed(BedSpaceStateLiteVo bedSpaceState) throws StaleObjectException
{
	if(bedSpaceState == null)
		throw new CodingRuntimeException("bedSpaceState is null in method saveReOpenOrAssignBed");
	
	//WDEV-8507
	bedSpaceState.setInpatientEpisode(null);
	
	getDomainFactory().save(BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState));	
}
 
Example 40
Project: openmaxims-linux   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public BedSpaceStateLiteVo getBedSpaceStateByInpatientEpisode(InpatientEpisodeRefVo inpat)
{
	if (inpat == null || inpat.getID_InpatientEpisode() == null)
		throw new CodingRuntimeException("inpat is null or id not provided in method getBedSpaceStateByInpatientEpisode");
	
	String hql = "from BedSpaceState as bed where bed.inpatientEpisode.id = " + inpat.getID_InpatientEpisode();
	List lstBeds = getDomainFactory().find(hql);
	if(lstBeds != null && lstBeds.size() == 1)
		return BedSpaceStateLiteVoAssembler.create((BedSpaceState) lstBeds.get(0));
	
	return null;
}