Java Code Examples for ims.core.vo.PendingTransfersLiteVo

The following are top voted examples for showing how to use ims.core.vo.PendingTransfersLiteVo. 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: Logic.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unused")
private boolean isInpatientEpisodeonTransefrOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if(voInpatEpis == null)
		throw new CodingRuntimeException("voInpatEpis is null in method isInpatientEpisodeonTransefrOutList");
	
	PendingTransfersLiteVoCollection voCollTransfersOut = form.getLocalContext().getTransfersOut();
	if(voCollTransfersOut == null)
		return false;
	
	for(PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if(voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return true;
	}
	
	return false;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private PendingTransfersLiteVo isInpatientEpisodeonTransferOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if (voInpatEpis == null)
		return null;

	PendingTransfersLiteVoCollection voCollTransfersOut = form.getGlobalContext().Core.getADTTransfersOut();
	if (voCollTransfersOut == null)
		return null;

	for (PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if (voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return voTransferOut;
	}

	return null;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isInpatientEpisodeonTransefrOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if(voInpatEpis == null)
		throw new CodingRuntimeException("voInpatEpis is null in method isInpatientEpisodeonTransefrOutList");
	
	PendingTransfersLiteVoCollection voCollTransfersOut = form.getLocalContext().getTransfersOut();
	if(voCollTransfersOut == null)
		return false;
	
	for(PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if(voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return true;
	}
	
	return false;
}
 
Example 4
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unused")
private boolean isInpatientEpisodeonTransefrOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if(voInpatEpis == null)
		throw new CodingRuntimeException("voInpatEpis is null in method isInpatientEpisodeonTransefrOutList");
	
	PendingTransfersLiteVoCollection voCollTransfersOut = form.getLocalContext().getTransfersOut();
	if(voCollTransfersOut == null)
		return false;
	
	for(PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if(voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return true;
	}
	
	return false;
}
 
Example 5
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PendingTransfersLiteVo isInpatientEpisodeonTransferOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if (ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.getGlobalContext().Core.getADTPendingTransferIsNotNull())
		return form.getGlobalContext().Core.getADTPendingTransfer();
	
	if (voInpatEpis == null)
		return null;

	PendingTransfersLiteVoCollection voCollTransfersOut = form.getGlobalContext().Core.getADTTransfersOut();
	if (voCollTransfersOut == null)
		return null;

	for (PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if (voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return voTransferOut;
	}

	return null;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PendingTransfersLiteVo populatePendingTransferOnAcceptFromScreen(PendingTransfersLiteVo value)
{
	if (value == null)
		return null;
	
	if (value.getPatientStatus() == null )
		value.setPatientStatus(value.getInpatientEpisode().getPasEvent().getPatient().getPatientCategory() != null ? value.getInpatientEpisode().getPasEvent().getPatient().getPatientCategory() : PatientStatus.NHS);
	value.setWardType(form.lyrDetail().tabTransfer().lyrTransfer().tabIn().cmbWardType().getValue());
	value.setService(form.lyrDetail().tabTransfer().lyrTransfer().tabIn().qmbInService().getValue());
	value.setSpecialty(form.lyrDetail().tabTransfer().lyrTransfer().tabIn().cmbInSpecialty().getValue());
	value.setTransferRequestDateTime(form.lyrDetail().tabTransfer().lyrTransfer().tabIn().dtimTransfer().getValue());
	value.setCurrentStatus(TransferStatus.TRANSFERRED);
	
	if (form.lyrDetail().tabTransfer().lyrTransfer().tabIn().ccInConsultant().getValue() instanceof MedicVo)
	{		
		value.setConsultant((MedicVo)form.lyrDetail().tabTransfer().lyrTransfer().tabIn().ccInConsultant().getValue());
	}
	return value;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PendingTransfersLiteVo populatePendingTransferDataFromScreen(PendingTransfersLiteVo selectedPendingTransfer)
{
	if (selectedPendingTransfer == null)
		return null;
	selectedPendingTransfer.setPatientStatus(form.cmbPatientStatus().getValue());
	selectedPendingTransfer.setWardType(form.cmbWardType().getValue());
	selectedPendingTransfer.setService(form.qmbService().getValue());
	selectedPendingTransfer.setSpecialty(form.cmbSpecialty().getValue());
	selectedPendingTransfer.setTransferRequestDateTime(form.dtimTransferAccept().getValue());
	selectedPendingTransfer.setCurrentStatus(TransferStatus.TRANSFERRED);
	
	if (form.ccConsultant().getValue() instanceof MedicVo)
	{		
		selectedPendingTransfer.setConsultant((MedicVo)form.ccConsultant().getValue());
	}
	
	return selectedPendingTransfer;
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean populateDataFromScreen(PendingTransfersLiteVo adtPendingTransfer)
{
	if (adtPendingTransfer == null)
		return false;
	
	if (validateUI())
	{	
		if (adtPendingTransfer.getCancellationReasonDetails() == null)
			adtPendingTransfer.setCancellationReasonDetails(new TransferCancellationReasonDetailsVo());
		adtPendingTransfer.getCancellationReasonDetails().setCancellationComments(form.txtComment().getValue());
		adtPendingTransfer.getCancellationReasonDetails().setCancellationReason(form.cmbCancellationReason().getValue());

		String[] validationErrors = adtPendingTransfer.validate();
		if (validationErrors != null)
		{
			engine.showErrors(validationErrors);
			return false;
		}
		form.getGlobalContext().Core.setADTPendingTransfer(adtPendingTransfer);
		return true;
	}
	return  false;
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open(Object[] args) throws FormOpenException
{
	if (args != null && args.length > 0 && args[0] instanceof PendingTransfersRefVo)
	{	
		PendingTransfersLiteVo voTransferForEdit = domain.getPendingTransfer((PendingTransfersRefVo)args[0]);
		if (voTransferForEdit == null)
		{	
			engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
			engine.close(DialogResult.ABORT);
			return;				
		}	
		
		form.getLocalContext().setCurrentPendingTransfer(voTransferForEdit);
		populateScreenFromData(voTransferForEdit);
	}
	else
	  throw new FormOpenException("The screen was not initialized correctly or the transfer record selected is invalid.");
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean save()
{
	PendingTransfersLiteVo voPendingTransferToSave = populateDataFromScreen((PendingTransfersLiteVo)form.getLocalContext().getCurrentPendingTransfer().clone());
	String[] errors = voPendingTransferToSave.validate(validateUiRules());
	if (errors != null)
	{	
		engine.showErrors(errors);
		return false;
	}
	try {
		domain.savePendingTransfer(voPendingTransferToSave);
	} 
	catch (DomainInterfaceException e)
	{
		engine.showMessage(e.getMessage());
		engine.close(DialogResult.ABORT);
		return false;
	}
	catch (StaleObjectException ex)
	{
		engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		engine.close(DialogResult.ABORT);
		return false;
	}
	return true;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PendingTransfersLiteVo populateDataFromScreen(PendingTransfersLiteVo voTransf)
{
	if (voTransf == null)
		return null;
	voTransf.setDestinationWard(form.qmbWard().getValue());
	voTransf.setBedAvailableDateTime(form.dtimBedAvailable().getValue());
	voTransf.setTransferRequestDateTime(form.dtimTransfReq().getValue());
	voTransf.setTransferReason(form.cmbTransferReason().getValue());
	voTransf.setTransferComment(form.txtTransfComment().getValue());
	voTransf.setWardType(form.cmbWardType().getValue());
	voTransf.setService(form.qmbService().getValue());
	voTransf.setSpecialty(form.cmbSpecialty().getValue());
	voTransf.setPatientStatus(form.cmbPatientCategory().getValue());
	voTransf.setConsultant(form.ccConsultant().getValue());
	
	return voTransf;
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isInpatientEpisodeonTransefrOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if(voInpatEpis == null)
		return false;
	
	PendingTransfersLiteVoCollection voCollTransfersOut = form.getLocalContext().getTransfersOut();
	if(voCollTransfersOut == null)
		return false;
	
	for(PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if(voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return true;
	}
	
	return false;
}
 
Example 13
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 6 votes vote down vote up
private BayTimesAdmissionBreachedVo populateBayTimesBreachedRecord(PendingTransfersLiteVo voTransfer, BedSpaceStateLiteVo voBedSpaceStateLite, AdmissionReasonVo admissionReasonVo)
{
	BayTimesAdmissionBreachedVo voBreach = new BayTimesAdmissionBreachedVo();
	
	voBreach.setAdmissionDateTime(voTransfer.getTransferRequestDateTime());
	voBreach.setWard(voTransfer.getDestinationWard());
	if (voBedSpaceStateLite != null)
		voBreach.setBay(voBedSpaceStateLite.getBay());
	Object mosUser = getHcpLiteUser();
	if (mosUser != null)
		voBreach.setMemberOfStaff(((HcpLiteVo) mosUser).getMos());
	voBreach.setReasonForAdmissionOutOfOpeningHours(admissionReasonVo.getReasonForAdmissionOutOfOpeningHours());
	voBreach.setReasonForAdmissionOutOfOpeningHoursComment(admissionReasonVo.getReasonForAdmissionOohComment());
	
	return voBreach;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unused")
private boolean isInpatientEpisodeonTransefrOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if(voInpatEpis == null)
		throw new CodingRuntimeException("voInpatEpis is null in method isInpatientEpisodeonTransefrOutList");
	
	PendingTransfersLiteVoCollection voCollTransfersOut = form.getLocalContext().getTransfersOut();
	if(voCollTransfersOut == null)
		return false;
	
	for(PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if(voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return true;
	}
	
	return false;
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PendingTransfersLiteVo isInpatientEpisodeonTransferOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if (voInpatEpis == null)
		return null;

	PendingTransfersLiteVoCollection voCollTransfersOut = form.getGlobalContext().Core.getADTTransfersOut();
	if (voCollTransfersOut == null)
		return null;

	for (PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if (voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return voTransferOut;
	}

	return null;
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isInpatientEpisodeonTransefrOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if(voInpatEpis == null)
		throw new CodingRuntimeException("voInpatEpis is null in method isInpatientEpisodeonTransefrOutList");
	
	PendingTransfersLiteVoCollection voCollTransfersOut = form.getLocalContext().getTransfersOut();
	if(voCollTransfersOut == null)
		return false;
	
	for(PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if(voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return true;
	}
	
	return false;
}
 
Example 17
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unused")
private boolean isInpatientEpisodeonTransefrOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if(voInpatEpis == null)
		throw new CodingRuntimeException("voInpatEpis is null in method isInpatientEpisodeonTransefrOutList");
	
	PendingTransfersLiteVoCollection voCollTransfersOut = form.getLocalContext().getTransfersOut();
	if(voCollTransfersOut == null)
		return false;
	
	for(PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if(voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return true;
	}
	
	return false;
}
 
Example 18
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private PendingTransfersLiteVo isInpatientEpisodeonTransferOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if (voInpatEpis == null)
		return null;

	PendingTransfersLiteVoCollection voCollTransfersOut = form.getGlobalContext().Core.getADTTransfersOut();
	if (voCollTransfersOut == null)
		return null;

	for (PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if (voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return voTransferOut;
	}

	return null;
}
 
Example 19
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isInpatientEpisodeonTransefrOutList(InpatientEpisodeRefVo voInpatEpis)
{
	if(voInpatEpis == null)
		throw new CodingRuntimeException("voInpatEpis is null in method isInpatientEpisodeonTransefrOutList");
	
	PendingTransfersLiteVoCollection voCollTransfersOut = form.getLocalContext().getTransfersOut();
	if(voCollTransfersOut == null)
		return false;
	
	for(PendingTransfersLiteVo voTransferOut : voCollTransfersOut)
	{
		if(voTransferOut.getInpatientEpisodeIsNotNull() && voTransferOut.getInpatientEpisode().equals(voInpatEpis))
			return true;
	}
	
	return false;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateTransferInListFromData()
{	
	enableTransferInControls(false);
	
	form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().clear();

	PendingTransfersLiteVoCollection voCollTransfersIn = form.getGlobalContext().Core.getADTTransfersIn();
	if (voCollTransfersIn == null)
		return;

	for (PendingTransfersLiteVo voTransfer : voCollTransfersIn)
	{
		grdTransferInRow tRow = form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().newRow();
		tRow.setColName(voTransfer.getPatientString());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
			tRow.setColConsultant(voTransfer.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getSpecialtyIsNotNull())
			tRow.setColSpecialty(voTransfer.getInpatientEpisode().getPasEvent().getSpecialty().getText());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getLocationIsNotNull())
			tRow.setColWard(voTransfer.getInpatientEpisode().getPasEvent().getLocation().getName());

		if (voTransfer.getTransferRequestDateTimeIsNotNull())
			tRow.setColRequestDate(voTransfer.getTransferRequestDateTime().toString());

		tRow.setValue(voTransfer);
	}

	if (form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().size() == 0)
		form.lyrDetail().tabTransfer().btnCancelTransfer().setVisible(false);
	else
		form.lyrDetail().tabTransfer().btnCancelTransfer().setEnabled(false);
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void setCareContextIfApplicable(DynamicGridRow row)
{
	if(row.getIdentifier() instanceof PASEventRefVo)
		form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent((PASEventRefVo) row.getIdentifier()));	
	else if(row.getIdentifier() instanceof PendingTransfersLiteVo)
	{
		if(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisodeIsNotNull())
			form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisode().getPasEvent()));
	}
	else if(row.getIdentifier() instanceof PendingTransfersLiteVo)
	{
		if(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisodeIsNotNull())
			form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisode().getPasEvent()));
	}
	else if(row.getIdentifier() instanceof InpatientEpisodeLiteVo)
	{
		form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((InpatientEpisodeLiteVo)row.getIdentifier()).getPasEvent()));
	}
	else if(row.getIdentifier() instanceof PendingElectiveAdmissionAdmitVo)
	{
		form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingElectiveAdmissionAdmitVo)row.getIdentifier()).getPasEvent()));
	}
	else
		form.getGlobalContext().Core.setCurrentCareContext(null);
	
	resetPIDBarText();//WDEV-14476 
	
}
 
Example 22
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public void saveTransferOut(PendingTransfersLiteVo pendingTransfer) throws StaleObjectException, DomainInterfaceException
{
	if(pendingTransfer == null)
		throw new CodingRuntimeException("pendingTransfer is null in method saveTransferOut");
	if(!pendingTransfer.isValidated())
		throw new CodingRuntimeException("pendingTransfer has not been validated in method saveTransferOut");
	
	//WDEV-9192
	if(pendingTransfer.getInpatientEpisodeIsNotNull())
	{
		String currentTransfer = "";
		if(pendingTransfer.getID_PendingTransfers() != null)
			currentTransfer = " and pt.id <> '" +  pendingTransfer.getID_PendingTransfers() + "'";
		
		List existingPTs = getDomainFactory().find("from PendingTransfers pt where pt.inpatientEpisode.id = '" + pendingTransfer.getInpatientEpisode().getID_InpatientEpisode() + "'" + currentTransfer);
		if(existingPTs != null && existingPTs.size() > 0)
			throw new DomainInterfaceException("Patient already has a transfer pending, the screen will be refreshed");
	}
	
	//WDEV-10421
	PendingTransfers doTransfer = PendingTransfersLiteVoAssembler.extractPendingTransfers(getDomainFactory(), pendingTransfer);
	//get the admission detail record and update its history for transfers
	AdmissionDetail doAdmissionDetail = populateTransferHistory(doTransfer, TRANSFEROUT, null);
		
	try
	{
		getDomainFactory().save(doTransfer);	
		if(doAdmissionDetail != null)
			getDomainFactory().save(doAdmissionDetail);	
	}
	catch (IllegalArgumentException e)
	{
		//where object has been deleted - this happens when a transfer in has been deleted (transfer complete) and this user has the old pending transfer record and is trying to update it
		throw new DomainInterfaceException("Patient's transfer has already been processed, the screen will be refreshed");
	}
}
 
Example 23
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public PendingTransfersLiteVo getPendingTransferForInpatient(InpatientEpisodeRefVo inpatEpis)
{
	if (inpatEpis == null || inpatEpis.getID_InpatientEpisode() == null)
		throw new CodingRuntimeException("inpatEpis is null or id not provided in method getPendingTransferForInpatient");

	List transfers = getDomainFactory().find("from PendingTransfers pTrans where pTrans.inpatientEpisode.id = " + inpatEpis.getID_InpatientEpisode());
	if(transfers != null && transfers.size() == 1)
		return PendingTransfersLiteVoAssembler.create((PendingTransfers) transfers.get(0));
		
	return null;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateTransferInListFromData()
{	
	enableTransferInControls(false);
	
	form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().clear();

	PendingTransfersLiteVoCollection voCollTransfersIn = form.getGlobalContext().Core.getADTTransfersIn();
	if (voCollTransfersIn == null)
		return;

	for (PendingTransfersLiteVo voTransfer : voCollTransfersIn)
	{
		grdTransferInRow tRow = form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().newRow();
		tRow.setColName(voTransfer.getPatientString());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
			tRow.setColConsultant(voTransfer.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getSpecialtyIsNotNull())
			tRow.setColSpecialty(voTransfer.getInpatientEpisode().getPasEvent().getSpecialty().getText());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getLocationIsNotNull())
			tRow.setColWard(voTransfer.getInpatientEpisode().getPasEvent().getLocation().getName());

		if (voTransfer.getTransferRequestDateTimeIsNotNull())
			tRow.setColRequestDate(voTransfer.getTransferRequestDateTime().toString());

		tRow.setValue(voTransfer);
	}

	if (form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().size() == 0)
		form.lyrDetail().tabTransfer().btnCancelTransfer().setVisible(false);
	else
		form.lyrDetail().tabTransfer().btnCancelTransfer().setEnabled(false);
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onGrdTransferInSelEctionChanged() throws PresentationLogicException 
{
	PendingTransfersLiteVo gridValue = form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getValue();
	boolean patientIsNotNull =gridValue!= null && gridValue.getInpatientEpisodeIsNotNull() && gridValue.getInpatientEpisode().getPasEventIsNotNull();
	
	if(patientIsNotNull)//WDEV-22851
		form.getLocalContext().setIsCaseNoteFolderVisible(domain.isCaseNoteFolderLocation(gridValue.getInpatientEpisode().getPasEvent().getPatient()));
	updateTransferInBedMaintenanceControls();
	enableTransferInControls(true);
	clearBedAllocationValidationContexts();
	populateTransferInTabFromData();
	updateCaseNoteFolderControl();//WDEV-22851
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateTransferInBedMaintenanceControls()
{
	if (ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS"))
	{
		PendingTransfersLiteVo transf = form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getValue();
		
		form.lyrDetail().tabTransfer().lyrTransfer().tabIn().lblAllocateBedTransf().setVisible(transf != null && transf.getInpatientEpisodeIsNotNull() && transf.getInpatientEpisode().getBedIsNotNull());
		form.lyrDetail().tabTransfer().lyrTransfer().tabIn().chkAllocateSourceBed().setVisible(transf != null && transf.getInpatientEpisodeIsNotNull() && transf.getInpatientEpisode().getBedIsNotNull());			
	}	
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open()
{
	form.getLocalContext().setSelectedPendingTransfer(form.getGlobalContext().Core.getADTPendingTransfer());
	PendingTransfersLiteVo selectedPendingTransfer = form.getLocalContext().getSelectedPendingTransfer();
	
	if(selectedPendingTransfer != null && selectedPendingTransfer.getInpatientEpisodeIsNotNull() && selectedPendingTransfer.getInpatientEpisode().getPasEventIsNotNull())//WDEV-22851
		form.getLocalContext().setIsCaseNoteFolderLocation(domain.isCaseNoteFolderLocation(selectedPendingTransfer.getInpatientEpisode().getPasEvent().getPatient()));
	populateScreenFromData(selectedPendingTransfer);
	updateControlsState();
	
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void recordBedReadyDetails(Object selectedVIEW)
{
	boolean isWardViewPatient = form.dyngrdPatients().getValue() instanceof WardViewPatientListVo;		
	boolean hasPendingTransfer = isWardViewPatient && ((WardViewPatientListVo)form.dyngrdPatients().getValue()).getPendingTransfer() != null;

	if (isWardViewPatient && hasPendingTransfer)
	{
		PendingTransfersLiteVo pendingTransfVo = domain.getPendingTransferLite(((WardViewPatientListVo)form.dyngrdPatients().getValue()).getPendingTransfer());
		form.getGlobalContext().Core.setADTPendingTransfer(pendingTransfVo);			
		boolean bedReadyReadOnlyMode = form.getLocalContext().getSelectedVIEW().equals(ims.core.forms.wardviewpatientsummarycomponent.Logic.ROW_TRANSFER_OUT) ? Boolean.TRUE : Boolean.FALSE;
		engine.open(form.getForms().Core.BedReadyDetailsDialog, new Object[]{bedReadyReadOnlyMode});
	}

}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void acceptTransferNoBed()
{
	boolean isWardViewPatient = form.dyngrdPatients().getValue() instanceof WardViewPatientListVo;
	boolean hasInpatientEpisode = isWardViewPatient && ((WardViewPatientListVo)form.dyngrdPatients().getValue()).getInpatientEpisode() != null;

	form.getGlobalContext().Core.setSelectedBedSpaceState(null);
	if (isWardViewPatient && hasInpatientEpisode)
	{	
		PendingTransfersLiteVo pendingTransf = domain.getPendingTransferLite(((WardViewPatientListVo)form.dyngrdPatients().getValue()).getPendingTransfer());
		form.getGlobalContext().Core.setADTPendingTransfer(pendingTransf);			
		engine.open(form.getForms().Core.AcceptTransferToWardDlg, "Accept Transfer to Ward");
	}
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void cancelTransfer()
{
	boolean isWardViewPatient = form.dyngrdPatients().getValue() instanceof WardViewPatientListVo;
	boolean hasInpatientEpisode = isWardViewPatient && ((WardViewPatientListVo)form.dyngrdPatients().getValue()).getInpatientEpisode() != null;
	boolean hasPendingTransfer = isWardViewPatient && ((WardViewPatientListVo)form.dyngrdPatients().getValue()).getPendingTransfer() != null;

	if (isWardViewPatient && hasPendingTransfer)
	{
		PendingTransfersLiteVo pendingTransfVo = domain.getPendingTransferLite(((WardViewPatientListVo)form.dyngrdPatients().getValue()).getPendingTransfer());
		form.getGlobalContext().Core.setADTPendingTransfer(pendingTransfVo);			
		engine.open(form.getForms().Core.TransferCancellation);
	}
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void setCareContextIfApplicable(DynamicGridRow row)
{
	if(row.getIdentifier() instanceof PASEventRefVo)
		form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent((PASEventRefVo) row.getIdentifier()));	
	else if(row.getIdentifier() instanceof PendingTransfersLiteVo)
	{
		if(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisodeIsNotNull())
			form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisode().getPasEvent()));
	}
	else if(row.getIdentifier() instanceof PendingTransfersLiteVo)
	{
		if(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisodeIsNotNull())
			form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisode().getPasEvent()));
	}
	else if(row.getIdentifier() instanceof InpatientEpisodeLiteVo)
	{
		form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((InpatientEpisodeLiteVo)row.getIdentifier()).getPasEvent()));
	}
	else if(row.getIdentifier() instanceof PendingElectiveAdmissionAdmitVo)
	{
		form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingElectiveAdmissionAdmitVo)row.getIdentifier()).getPasEvent()));
	}
	else
		form.getGlobalContext().Core.setCurrentCareContext(null);
	
	resetPIDBarText();//WDEV-14476 
	
}
 
Example 32
Project: openMAXIMS   File: WardViewPatientListImpl.java   Source Code and License 5 votes vote down vote up
public PendingTransfersLiteVo getPendingTransferLite(PendingTransfersRefVo transfer)
{
	if (transfer == null || transfer.getID_PendingTransfers() == null)
		return null;
	
	return PendingTransfersLiteVoAssembler.create((PendingTransfers) getDomainFactory().getDomainObject(PendingTransfers.class, transfer.getID_PendingTransfers()));
}
 
Example 33
Project: openMAXIMS   File: WardViewPatientListImpl.java   Source Code and License 5 votes vote down vote up
public void updatePendingTransfer(PendingTransfersLiteVo pendingTransf)	throws StaleObjectException
{
	if(pendingTransf == null)
		throw new CodingRuntimeException("pendingTransfer is null in method updatePendingTransfer");
	
	PendingTransfers doTransfer = PendingTransfersLiteVoAssembler.extractPendingTransfers(getDomainFactory(), pendingTransf);
	
	getDomainFactory().save(doTransfer);		
}
 
Example 34
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public void cancelTransfer(PendingTransfersLiteVo voTransfer, LocationRefVo voCancellingFromWard) throws StaleObjectException, ForeignKeyViolationException
{		
	if (voTransfer == null || voTransfer.getID_PendingTransfers() == null)
		throw new CodingRuntimeException("voTransfer is null or id not provided in method cancelTransfer");
	
	//WDEV-10421 - get the admission detail record and update its history for transfers
	PendingTransfers doPending = (PendingTransfers) getDomainFactory().getDomainObject(voTransfer);
	
	if (doPending == null || doPending.getVersion() > voTransfer.getVersion_PendingTransfers()) //WDEV-20326
		throw new StaleObjectException(doPending, "This transfer has been processed by another user");
	
	AdmissionDetail doAdmissionDetail = populateTransferHistory(doPending, TRANSFERCANCEL, voCancellingFromWard, voTransfer.getCancellationReasonDetails());
	
	// WDEV-19774 - Trigger creation of A26 Cancel Pending Transfer HL7 message
	InpatientEpisodeVo inpatEpisodeVo = InpatientEpisodeVoAssembler.create(doPending.getInpatientEpisode());
	if(inpatEpisodeVo.getPasEvent()!=null)
	{
    	ADT adtimpl = (ADT) getDomainImpl(ADTImpl.class);
		adtimpl.triggerCancelPendingTransferEvent(inpatEpisodeVo.getPasEvent());
	} //WDEV-19974

	getDomainFactory().delete("from PendingTransfers p where p.id = '" + voTransfer.getID_PendingTransfers() + "'");
	
	//WDEV-10421
	if(doAdmissionDetail != null)
		getDomainFactory().save(doAdmissionDetail);
}
 
Example 35
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public PendingTransfersLiteVo getPendingTransferForInpatient(InpatientEpisodeRefVo inpatEpis)
{
	if (inpatEpis == null || inpatEpis.getID_InpatientEpisode() == null)
		return null;

	List<?> transfers = getDomainFactory().find("from PendingTransfers pTrans WHERE pTrans.inpatientEpisode.id = " + inpatEpis.getID_InpatientEpisode() + " AND pTrans.currentStatus.id = " + TransferStatus.PENDING.getId());
	if(transfers != null && transfers.size() == 1)
		return PendingTransfersLiteVoAssembler.create((PendingTransfers) transfers.get(0));
		
	return null;
}
 
Example 36
Project: openMAXIMS   File: AcceptTransferToWardDlgImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.CareContextShortVo saveTransferIn(ims.core.vo.BedSpaceStateLiteVo voOldBedSpaceStateLite, ims.core.vo.InPatientEpisodeADTVo voInpatientEpisode, ims.core.vo.PendingTransfersLiteVo voPending, ims.core.vo.HomeLeaveVo voHL ,PatientCaseNoteTransferVoCollection collPatientCaseNoteTransfer) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
	PendingTransfersLiteVo transferVo = getPendingTransfer(voPending);
	if (transferVo == null || (transferVo.getVersion_PendingTransfers()  > voPending.getVersion_PendingTransfers()))
		throw new DomainInterfaceException("This transfer has been already processed");
	
	 BedInfoDialog impl = (BedInfoDialog) getDomainImpl(BedInfoDialogImpl.class);
	 return impl.saveTransferIn(voOldBedSpaceStateLite, voInpatientEpisode, voPending, voHL, null, null, collPatientCaseNoteTransfer);
}
 
Example 37
Project: openMAXIMS   File: WardDataViewImpl.java   Source Code and License 5 votes vote down vote up
public PendingTransfersLiteVo getPendingTransfer(PendingTransfersRefVo pendingTransferRef)
{
	if (pendingTransferRef == null)
		return null;
	DomainFactory factory = getDomainFactory();

	PendingTransfers doPendingTransfer = (PendingTransfers) factory.getDomainObject(PendingTransfers.class, pendingTransferRef.getID_PendingTransfers());
	if (doPendingTransfer != null && TransferStatus.PENDING.getID() == doPendingTransfer.getCurrentStatus().getId())
		return PendingTransfersLiteVoAssembler.create(doPendingTransfer);

	return null;
}
 
Example 38
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateTransferInListFromData()
{	
	enableTransferInControls(false);
	
	form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().clear();

	PendingTransfersLiteVoCollection voCollTransfersIn = form.getGlobalContext().Core.getADTTransfersIn();
	if (voCollTransfersIn == null)
		return;

	for (PendingTransfersLiteVo voTransfer : voCollTransfersIn)
	{
		grdTransferInRow tRow = form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().newRow();
		tRow.setColName(voTransfer.getPatientString());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getConsultantIsNotNull())
			tRow.setColConsultant(voTransfer.getInpatientEpisode().getPasEvent().getConsultant().getIMosName());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getSpecialtyIsNotNull())
			tRow.setColSpecialty(voTransfer.getInpatientEpisode().getPasEvent().getSpecialty().getText());

		if (voTransfer.getInpatientEpisodeIsNotNull() && voTransfer.getInpatientEpisode().getPasEventIsNotNull() && voTransfer.getInpatientEpisode().getPasEvent().getLocationIsNotNull())
			tRow.setColWard(voTransfer.getInpatientEpisode().getPasEvent().getLocation().getName());

		if (voTransfer.getTransferRequestDateTimeIsNotNull())
			tRow.setColRequestDate(voTransfer.getTransferRequestDateTime().toString());

		tRow.setValue(voTransfer);
	}

	if (form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getRows().size() == 0)
		form.lyrDetail().tabTransfer().btnCancelTransfer().setVisible(false);
	else
		form.lyrDetail().tabTransfer().btnCancelTransfer().setEnabled(false);
}
 
Example 39
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void setCareContextIfApplicable(DynamicGridRow row)
{
	if(row.getIdentifier() instanceof PASEventRefVo)
		form.getGlobalContext().Core.setCurrentCareContext( domain.getCareContextForPasEvent((PASEventRefVo) row.getIdentifier()));	
	else if(row.getIdentifier() instanceof PendingTransfersLiteVo)
	{
		if(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisodeIsNotNull())
			form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisode().getPasEvent()));
	}
	else if(row.getIdentifier() instanceof PendingTransfersLiteVo)
	{
		if(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisodeIsNotNull())
			form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingTransfersLiteVo)row.getIdentifier()).getInpatientEpisode().getPasEvent()));
	}
	else if(row.getIdentifier() instanceof InpatientEpisodeLiteVo)
	{
		form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((InpatientEpisodeLiteVo)row.getIdentifier()).getPasEvent()));
	}
	else if(row.getIdentifier() instanceof PendingElectiveAdmissionAdmitVo)
	{
		form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextForPasEvent(((PendingElectiveAdmissionAdmitVo)row.getIdentifier()).getPasEvent()));
	}
	else
		form.getGlobalContext().Core.setCurrentCareContext(null);
	
	resetPIDBarText();//WDEV-14476 
	
}
 
Example 40
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public void saveTransferOut(PendingTransfersLiteVo pendingTransfer) throws StaleObjectException, DomainInterfaceException
{
	if(pendingTransfer == null)
		throw new CodingRuntimeException("pendingTransfer is null in method saveTransferOut");
	if(!pendingTransfer.isValidated())
		throw new CodingRuntimeException("pendingTransfer has not been validated in method saveTransferOut");
	
	//WDEV-9192
	if(pendingTransfer.getInpatientEpisodeIsNotNull())
	{
		String currentTransfer = "";
		if(pendingTransfer.getID_PendingTransfers() != null)
			currentTransfer = " and pt.id <> '" +  pendingTransfer.getID_PendingTransfers() + "'";
		
		List existingPTs = getDomainFactory().find("from PendingTransfers pt where pt.inpatientEpisode.id = '" + pendingTransfer.getInpatientEpisode().getID_InpatientEpisode() + "'" + currentTransfer);
		if(existingPTs != null && existingPTs.size() > 0)
			throw new DomainInterfaceException("Patient already has a transfer pending, the screen will be refreshed");
	}
	
	//WDEV-10421
	PendingTransfers doTransfer = PendingTransfersLiteVoAssembler.extractPendingTransfers(getDomainFactory(), pendingTransfer);
	//get the admission detail record and update its history for transfers
	AdmissionDetail doAdmissionDetail = populateTransferHistory(doTransfer, TRANSFEROUT, null);
		
	try
	{
		getDomainFactory().save(doTransfer);	
		if(doAdmissionDetail != null)
			getDomainFactory().save(doAdmissionDetail);	
	}
	catch (IllegalArgumentException e)
	{
		//where object has been deleted - this happens when a transfer in has been deleted (transfer complete) and this user has the old pending transfer record and is trying to update it
		throw new DomainInterfaceException("Patient's transfer has already been processed, the screen will be refreshed");
	}
}