Java Code Examples for ims.core.vo.BedSpaceStateLiteVo.getInpatientEpisodeIsNotNull()

The following are Jave code examples for showing how to use getInpatientEpisodeIsNotNull() of the ims.core.vo.BedSpaceStateLiteVo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void populateConsultantTransferTabFromData()
{
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue("");
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();
	if(voBedSpaceState != null)
	{
		if(voBedSpaceState.getInpatientEpisodeIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEventIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());
	}
	else if (form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull())
	{
		InPatientEpisodeADTVo voEpisode = domain.getInpatientEpisode(form.getGlobalContext().Core.getSelectedWaitingAreaPatient());
		if (voEpisode != null && voEpisode.getPasEventIsNotNull() && voEpisode.getPasEvent().getConsultantIsNotNull()) //WDEV-16004
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voEpisode.getPasEvent().getConsultant().getIMosName());
	}
	
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().initialize(MosType.MEDIC);
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().isRequired(true);
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().dtimConsultantTransfer().setValue(new DateTime());
}
 
Example 2
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 6 votes
private void populateConsultantTransferTabFromData()
{
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue("");
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();
	if(voBedSpaceState != null)
	{
		if(voBedSpaceState.getInpatientEpisodeIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEventIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());
	}
	else if (form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull())
	{
		InPatientEpisodeADTVo voEpisode = domain.getInpatientEpisode(form.getGlobalContext().Core.getSelectedWaitingAreaPatient());
		if (voEpisode != null && voEpisode.getPasEventIsNotNull() && voEpisode.getPasEvent().getConsultantIsNotNull()) //WDEV-16004
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voEpisode.getPasEvent().getConsultant().getIMosName());
	}
	
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().initialize(MosType.MEDIC);
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().isRequired(true);
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().dtimConsultantTransfer().setValue(new DateTime());
}
 
Example 3
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 6 votes
private void populateConsultantTransferTabFromData()
{
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue("");
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();
	if(voBedSpaceState != null)
	{
		if(voBedSpaceState.getInpatientEpisodeIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEventIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());
	}
	else if (form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull())
	{
		InPatientEpisodeADTVo voEpisode = domain.getInpatientEpisode(form.getGlobalContext().Core.getSelectedWaitingAreaPatient());
		if (voEpisode != null && voEpisode.getPasEventIsNotNull() && voEpisode.getPasEvent().getConsultantIsNotNull()) //WDEV-16004
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voEpisode.getPasEvent().getConsultant().getIMosName());
	}
	
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().initialize(MosType.MEDIC);
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().isRequired(true);
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().dtimConsultantTransfer().setValue(new DateTime());
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private DischargedEpisodeADTVo createInfantDischarge(InpatientEpisodeLiteVo voInpat)
{
	DischargedEpisodeADTVo voDischargedEpisode = new DischargedEpisodeADTVo();

	voDischargedEpisode.setDischargeDateTime(form.lyrDetail().tabDischarge().dtimDischarge().getValue());
	voDischargedEpisode.setDischargeDestination(form.lyrDetail().tabDischarge().cmbDischargeDestination().getValue());
	voDischargedEpisode.setMethodOfDischarge(form.lyrDetail().tabDischarge().cmbMethodDischarge().getValue());

	BedSpaceStateLiteVo voBedSpaceState = domain.getBedSpaceStateByInpatientEpisode(voInpat);
	if (voBedSpaceState != null && voBedSpaceState.getInpatientEpisodeIsNotNull())
	{
		voDischargedEpisode.setPasEvent(voBedSpaceState.getInpatientEpisode().getPasEvent());
		voDischargedEpisode.setConsultantStays(voBedSpaceState.getInpatientEpisode().getConsultantStays());
		voDischargedEpisode.setWardStays(voBedSpaceState.getInpatientEpisode().getWardStays());
	}
	else
		voDischargedEpisode.setPasEvent(voInpat.getPasEvent());

	// move to previous
	if (voBedSpaceState != null && voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(form.lyrDetail().tabDischarge().chkAllocateForCleaning().getValue() ? BedStatus.FOR_CLEANING : BedStatus.AVAILABLE);
	}

	voDischargedEpisode.setIsActive(true);
	voDischargedEpisode.setBedSpaceForInfant(voBedSpaceState);
	return voDischargedEpisode;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
@Override
protected void onBedPlannerBedClicked(Bed bed) 
{
	form.getGlobalContext().Core.setSelectedWaitingAreaPatient(null);
	form.getGlobalContext().Core.setBedInfoAction(null);
	form.dyngrdDisplay().setValue(null);
	
	form.getGlobalContext().Core.setPatientShort(null);
	if (bed != null && bed.getIdentifier() != null)
	{
		BedSpaceStateLiteVo bedSpaceState = domain.getBedSpaceState((BedSpaceVo) bed.getIdentifier());
		
		form.getGlobalContext().Core.setSelectedBedSpaceState(bedSpaceState);
		
		if (bedSpaceState != null && bedSpaceState.getInpatientEpisodeIsNotNull() 
				&& bedSpaceState.getInpatientEpisode().getPasEventIsNotNull() 
				&& bedSpaceState.getInpatientEpisode().getPasEvent().getPatientIsNotNull())
		{
			form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName());
			form.getGlobalContext().Core.setPatientShort(bedSpaceState.getInpatientEpisode().getPasEvent().getPatient());
		}
	
		if(bedSpaceState.getInpatientEpisode() != null)
			form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent(bedSpaceState.getInpatientEpisode().getPasEvent()));
	}
	
	resetPIDBarText();//WDEV-14476 
	
	//WDEV-9790
	engine.open(form.getForms().Core.BedInfoDialog, new Object[]{new Boolean(form.isReadOnly())});
}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private DischargedEpisodeADTVo createInfantDischarge(InpatientEpisodeLiteVo voInpat)
{
	DischargedEpisodeADTVo voDischargedEpisode = new DischargedEpisodeADTVo();

	voDischargedEpisode.setDischargeDateTime(form.lyrDetail().tabDischarge().dtimDischarge().getValue());
	voDischargedEpisode.setDischargeDestination(form.lyrDetail().tabDischarge().cmbDischargeDestination().getValue());
	voDischargedEpisode.setMethodOfDischarge(form.lyrDetail().tabDischarge().cmbMethodDischarge().getValue());

	BedSpaceStateLiteVo voBedSpaceState = domain.getBedSpaceStateByInpatientEpisode(voInpat);
	if (voBedSpaceState != null && voBedSpaceState.getInpatientEpisodeIsNotNull())
	{
		voDischargedEpisode.setPasEvent(voBedSpaceState.getInpatientEpisode().getPasEvent());
		voDischargedEpisode.setConsultantStays(voBedSpaceState.getInpatientEpisode().getConsultantStays());
		voDischargedEpisode.setWardStays(voBedSpaceState.getInpatientEpisode().getWardStays());
	}
	else
		voDischargedEpisode.setPasEvent(voInpat.getPasEvent());

	// move to previous
	if (voBedSpaceState != null && voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(form.lyrDetail().tabDischarge().chkAllocateForCleaning().getValue() ? BedStatus.FOR_CLEANING : BedStatus.AVAILABLE);
	}

	voDischargedEpisode.setIsActive(true);
	voDischargedEpisode.setBedSpaceForInfant(voBedSpaceState);
	return voDischargedEpisode;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void populateConsultantTransferTabFromData()
{
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue("");
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();
	if(voBedSpaceState != null)
	{
		if(voBedSpaceState.getInpatientEpisodeIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEventIsNotNull() && voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voBedSpaceState.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());
		
		ConsultantStayMinVo currentConsultantStay = domain.getCurrentConsultantStay(voBedSpaceState.getInpatientEpisode());
		
		if (currentConsultantStay != null)
		{
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().cmbPatientCategoryConsultant().setValue(currentConsultantStay.getPatientStatus());
		}
	}
	else if (form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull())
	{
		InPatientEpisodeADTVo voEpisode = domain.getInpatientEpisode(form.getGlobalContext().Core.getSelectedWaitingAreaPatient());
		if (voEpisode != null && voEpisode.getPasEventIsNotNull() && voEpisode.getPasEvent().getConsultantIsNotNull()) //WDEV-16004
			form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().lblCurrentCons().setValue(voEpisode.getPasEvent().getConsultant().getIMosName());
	}
	populateSpecialtyForService(form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().qmbConsultantService().getValue());
	if (form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().qmbConsultantService().getValue() == null || !ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS"))
	{	
		form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().initialize(MosType.MEDIC);
	}
	else if (form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().qmbConsultantService().getValue() != null)
	{
		form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().initializeResponsibleHcp(MosType.MEDIC, null, form.lyrDetail().tabTransfer().lyrTransfer().tabOut().qmbOutService().getValue(), null);
	}		
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().ccConsultantAccepting().isRequired(true);
	form.lyrDetail().tabTransfer().lyrTransfer().tabConsultant().dtimConsultantTransfer().setValue(new DateTime());
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private void recordTransfer()
{
	boolean isWardViewPatient = form.dyngrdPatients().getValue() instanceof WardViewPatientListVo;
	boolean hasInpatientEpisode = isWardViewPatient && ((WardViewPatientListVo)form.dyngrdPatients().getValue()).getInpatientEpisode() != null;
	boolean isOnHomeLeaveView = isWardViewPatient && hasInpatientEpisode && form.getLocalContext().getSelectedVIEW() != null && (form.getLocalContext().getSelectedVIEW().equals(ims.core.forms.wardviewpatientsummarycomponent.Logic.ROW_HOME_LEAVE) || form.getLocalContext().getSelectedVIEW().equals(ims.core.forms.wardviewpatientsummarycomponent.Logic.ROW_HOME_LEAVE_WITH_BED));
	boolean isPatientOnHomeLeave  = false;  
	boolean hasPendingTransfer = isWardViewPatient && (Boolean.TRUE.equals(((WardViewPatientListVo)form.dyngrdPatients().getValue()).getHasPendingTransfer()) || ((WardViewPatientListVo)form.dyngrdPatients().getValue()).getPendingTransfer() != null);

	if (isOnHomeLeaveView || (isWardViewPatient && hasInpatientEpisode))
	{
		WardViewPatientListVo selectedRecord = (WardViewPatientListVo) form.dyngrdPatients().getValue();
		if (selectedRecord != null)
		{	
			if (selectedRecord.getBedSpaceStateIsNotNull())
			{
				BedSpaceStateLiteVo selectedPatientBedSpace = domain.getSelectedBedSpaceState(selectedRecord.getBedSpaceState());

				form.getGlobalContext().Core.setSelectedWaitingAreaPatient(null);
				form.getGlobalContext().Core.setSelectedBedSpaceState(selectedPatientBedSpace);					
				isPatientOnHomeLeave = hasInpatientEpisode &&  selectedPatientBedSpace.getInpatientEpisodeIsNotNull() && Boolean.TRUE.equals(selectedPatientBedSpace.getInpatientEpisode().getIsOnHomeLeave());
			}
			else				
			{
				InpatientEpisodeLiteVo selectedInpatientEpisode = domain.getInpatientEpisodeLite(((WardViewPatientListVo)form.dyngrdPatients().getValue()).getInpatientEpisode());

				form.getGlobalContext().Core.setSelectedBedSpaceState(null);
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient(selectedInpatientEpisode);					
				isPatientOnHomeLeave = hasInpatientEpisode &&  Boolean.TRUE.equals(selectedInpatientEpisode.getIsOnHomeLeave());
			}
		}

		form.getGlobalContext().Core.setBedInfoAction(isOnHomeLeaveView  || isPatientOnHomeLeave ? BedInfoAction.TRANSFERHOMELEAVEPATIENT : (form.getGlobalContext().Core.getSelectedWaitingAreaPatientIsNotNull() ? BedInfoAction.TRANSFERWAITINGAREAPATIENT : BedInfoAction.TRANSFERWARDPATIENT));
		if (hasInpatientEpisode || hasPendingTransfer)
		{	
			form.getGlobalContext().Core.setADTPendingTransfer(hasPendingTransfer ? domain.getPendingTransferLite(((WardViewPatientListVo)form.dyngrdPatients().getValue()).getPendingTransfer()) : (hasInpatientEpisode ? domain.getPendingTransferForInpatientEpisode(((WardViewPatientListVo)form.dyngrdPatients().getValue()).getInpatientEpisode()) : null));
		}
		engine.open(form.getForms().Core.BedInfoDialog, new Object[] {!isOnHomeLeaveView || hasPendingTransfer ? BedDialogPatientDataTabs.TAB_TRANSFER_OUT : BedDialogPatientDataTabs.TAB_TRANSFER_CONSULTANT});
	}
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
private DischargedEpisodeADTVo createInfantDischarge(InpatientEpisodeLiteVo voInpat)
{
	DischargedEpisodeADTVo voDischargedEpisode = new DischargedEpisodeADTVo();

	voDischargedEpisode.setDischargeDateTime(form.lyrDetail().tabDischarge().dtimDischarge().getValue());
	voDischargedEpisode.setDischargeDestination(form.lyrDetail().tabDischarge().cmbDischargeDestination().getValue());
	voDischargedEpisode.setMethodOfDischarge(form.lyrDetail().tabDischarge().cmbMethodDischarge().getValue());

	BedSpaceStateLiteVo voBedSpaceState = domain.getBedSpaceStateByInpatientEpisode(voInpat);
	if (voBedSpaceState != null && voBedSpaceState.getInpatientEpisodeIsNotNull())
	{
		voDischargedEpisode.setPasEvent(voBedSpaceState.getInpatientEpisode().getPasEvent());
		voDischargedEpisode.setConsultantStays(voBedSpaceState.getInpatientEpisode().getConsultantStays());
		voDischargedEpisode.setWardStays(voBedSpaceState.getInpatientEpisode().getWardStays());
	}
	else
		voDischargedEpisode.setPasEvent(voInpat.getPasEvent());

	// move to previous
	if (voBedSpaceState != null && voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(form.lyrDetail().tabDischarge().chkAllocateForCleaning().getValue() ? BedStatus.FOR_CLEANING : BedStatus.AVAILABLE);
	}

	voDischargedEpisode.setIsActive(true);
	voDischargedEpisode.setBedSpaceForInfant(voBedSpaceState);
	return voDischargedEpisode;
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License Vote up 5 votes
@Override
protected void onBedPlannerBedClicked(Bed bed) 
{
	form.getGlobalContext().Core.setSelectedWaitingAreaPatient(null);
	form.getGlobalContext().Core.setBedInfoAction(null);
	form.dyngrdDisplay().setValue(null);
	
	form.getGlobalContext().Core.setPatientShort(null);
	if (bed != null && bed.getIdentifier() != null)
	{
		BedSpaceStateLiteVo bedSpaceState = domain.getBedSpaceState((BedSpaceVo) bed.getIdentifier());
		
		form.getGlobalContext().Core.setSelectedBedSpaceState(bedSpaceState);
		
		if (bedSpaceState != null && bedSpaceState.getInpatientEpisodeIsNotNull() 
				&& bedSpaceState.getInpatientEpisode().getPasEventIsNotNull() 
				&& bedSpaceState.getInpatientEpisode().getPasEvent().getPatientIsNotNull())
		{
			form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName());
			form.getGlobalContext().Core.setPatientShort(bedSpaceState.getInpatientEpisode().getPasEvent().getPatient());
		}
	
		if(bedSpaceState.getInpatientEpisode() != null)
			form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent(bedSpaceState.getInpatientEpisode().getPasEvent()));
	}
	
	resetPIDBarText();//WDEV-14476 
	
	//WDEV-9790
	engine.open(form.getForms().Core.BedInfoDialog, new Object[]{new Boolean(form.isReadOnly())});
}
 
Example 11
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 5 votes
private DischargedEpisodeADTVo createInfantDischarge(InpatientEpisodeLiteVo voInpat)
{
	DischargedEpisodeADTVo voDischargedEpisode = new DischargedEpisodeADTVo();

	voDischargedEpisode.setDischargeDateTime(form.lyrDetail().tabDischarge().dtimDischarge().getValue());
	voDischargedEpisode.setDischargeDestination(form.lyrDetail().tabDischarge().cmbDischargeDestination().getValue());
	voDischargedEpisode.setMethodOfDischarge(form.lyrDetail().tabDischarge().cmbMethodDischarge().getValue());

	BedSpaceStateLiteVo voBedSpaceState = domain.getBedSpaceStateByInpatientEpisode(voInpat);
	if (voBedSpaceState != null && voBedSpaceState.getInpatientEpisodeIsNotNull())
	{
		voDischargedEpisode.setPasEvent(voBedSpaceState.getInpatientEpisode().getPasEvent());
		voDischargedEpisode.setConsultantStays(voBedSpaceState.getInpatientEpisode().getConsultantStays());
		voDischargedEpisode.setWardStays(voBedSpaceState.getInpatientEpisode().getWardStays());
	}
	else
		voDischargedEpisode.setPasEvent(voInpat.getPasEvent());

	// move to previous
	if (voBedSpaceState != null && voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(form.lyrDetail().tabDischarge().chkAllocateForCleaning().getValue() ? BedStatus.FOR_CLEANING : BedStatus.AVAILABLE);
	}

	voDischargedEpisode.setIsActive(true);
	voDischargedEpisode.setBedSpaceForInfant(voBedSpaceState);
	return voDischargedEpisode;
}
 
Example 12
Project: openmaxims-linux   File: Logic.java   Source Code and License Vote up 5 votes
@Override
protected void onBedPlannerBedClicked(Bed bed) 
{
	form.getGlobalContext().Core.setSelectedWaitingAreaPatient(null);
	form.getGlobalContext().Core.setBedInfoAction(null);
	form.dyngrdDisplay().setValue(null);
	
	form.getGlobalContext().Core.setPatientShort(null);
	if (bed != null && bed.getIdentifier() != null)
	{
		BedSpaceStateLiteVo bedSpaceState = domain.getBedSpaceState((BedSpaceVo) bed.getIdentifier());
		
		form.getGlobalContext().Core.setSelectedBedSpaceState(bedSpaceState);
		
		if (bedSpaceState != null && bedSpaceState.getInpatientEpisodeIsNotNull() 
				&& bedSpaceState.getInpatientEpisode().getPasEventIsNotNull() 
				&& bedSpaceState.getInpatientEpisode().getPasEvent().getPatientIsNotNull())
		{
			form.getGlobalContext().Core.setSelectingPatientForm(engine.getFormName());
			form.getGlobalContext().Core.setPatientShort(bedSpaceState.getInpatientEpisode().getPasEvent().getPatient());
		}
	
		if(bedSpaceState.getInpatientEpisode() != null)
			form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent(bedSpaceState.getInpatientEpisode().getPasEvent()));
	}
	
	resetPIDBarText();//WDEV-14476 
	
	//WDEV-9790
	engine.open(form.getForms().Core.BedInfoDialog, new Object[]{new Boolean(form.isReadOnly())});
}
 
Example 13
Project: openMAXIMS   File: WardViewImpl.java   Source Code and License Vote up 4 votes
public BedSpaceStateLiteVo getBedSpaceState(BedSpaceRefVo bed) 
{
	if(bed == null )
		throw new DomainRuntimeException("Invalid BedRefVo");
	
	String hql = "select bs,(select adm.healthyLodger from AdmissionDetail as adm where adm.pasEvent.id = bs.inpatientEpisode.pasEvent.id) from BedSpaceState as bs left join bs.bedSpace as bed where bed.id = " + bed.getID_BedSpace();
	
	List<?> bedState = null;
	
	//WDEV-23014 - Catch the Lock error and retry the entire transaction. After two retries, throw a SOE message. 

	try
	{
		bedState = getDomainFactory().find(hql);
	}
	catch (RuntimeException e) {
		if (e instanceof LockAcquisitionException) 
		{
			try
			{
				bedState = getDomainFactory().find(hql);
			}
			catch (RuntimeException e1) 
			{
				if (e1 instanceof LockAcquisitionException) 
				{
					throw new StaleStateException(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
				}
			}
		}
	}
	//WDEV-23014 ends here
	
	//WDEV-11039
	boolean hasAlerts = false;
	BedSpaceStateLiteVoCollection voColl  = new BedSpaceStateLiteVoCollection();
	if (bedState != null && bedState.size() > 0 && bedState.get(0) instanceof Object[])
	{
		Object[] recordDO = (Object[]) bedState.get(0);
		BedSpaceStateLiteVo bs = null;
		for (int i =0;i<recordDO.length;i++)
		{				
			if (recordDO[0] instanceof BedSpaceState)
			{	
				BedSpaceState doBed = (BedSpaceState)recordDO[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;

				bs  = BedSpaceStateLiteVoAssembler.create((BedSpaceState)recordDO[0]);
			}	
			if (bs.getInpatientEpisodeIsNotNull() && recordDO[1] != null && recordDO[1] instanceof HealthyLodger)
				bs.getInpatientEpisode().setHealthyLodgerDetails(HealthyLodgerVoAssembler.create((HealthyLodger)recordDO[1]));
		}
		if (bs != null)
			voColl.add(bs);

	}
	//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;
}