Java Code Examples for ims.core.vo.PendingElectiveAdmissionAdmitVo

The following are top voted examples for showing how to use ims.core.vo.PendingElectiveAdmissionAdmitVo. 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: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdElectiveSelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{
	form.getLocalContext().setRecordSelected(true);
	
	PendingElectiveAdmissionAdmitVo electiveRecordSelection = form.lyrAdmission().tabBooked().grdElective().getValue();
	if (electiveRecordSelection != null && electiveRecordSelection.getPasEvent() != null)
	{
		form.getGlobalContext().Core.setPatientShort(domain.getPatientShort(electiveRecordSelection.getPasEvent().getPatient()));
	}
	form.getLocalContext().setIsCaseNoteFolderVisible(domain.isCaseNoteFolderLocation(form.getGlobalContext().Core.getPatientShort()));//WDEV-22803
	
	if (electiveRecordSelection != null && electiveRecordSelection.getPasEvent() != null)
		setSexForSelectedpatient(electiveRecordSelection.getPasEvent().getPatient());
		
	enableInstanceControls(true);
	populateScreenFromPendingAdmissionData(electiveRecordSelection, true);
	updateCaseNoteLocationState();
	form.fireCustomControlValueChanged();
}
 
Example 2
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdTCISelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{
	form.getLocalContext().setRecordSelected(true);
	
	PendingElectiveAdmissionAdmitVo electiveTCISelection = form.lyrAdmission().tabPlanned().grdTCI().getValue();
	if (electiveTCISelection != null && electiveTCISelection.getPasEvent() != null)
	{
		form.getGlobalContext().Core.setPatientShort(domain.getPatientShort(electiveTCISelection.getPasEvent().getPatient()));
		setSexForSelectedpatient(electiveTCISelection.getPasEvent().getPatient());
	}
	
	enableInstanceControls(true);
	populateScreenFromPendingAdmissionData(electiveTCISelection, false);
	form.fireCustomControlValueChanged();
}
 
Example 3
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 4
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 5
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 6
Project: openmaxims-linux   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 7
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException
{
	switch (menuItemID)
	{
		case GenForm.ContextMenus.CoreNamespace.WardView.TRANSFER:
			form.getGlobalContext().Core.setSelectedBedSpaceState(null);
			form.getGlobalContext().Core.setBedInfoAction(BedInfoAction.TRANSFERWAITINGAREAPATIENT); 
			if(form.dyngrdDisplay().getSelectedRow() != null && form.dyngrdDisplay().getSelectedRow().getIdentifier() instanceof InpatientEpisodeLiteVo)
			{
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient((InpatientEpisodeLiteVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
				engine.open(form.getForms().Core.BedInfoDialog);
			}
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.DISCHARGE:
			form.getGlobalContext().Core.setSelectedBedSpaceState(null);
			form.getGlobalContext().Core.setBedInfoAction(BedInfoAction.DISCHARGEWAITINGAREAPATIENT); 
			if(form.dyngrdDisplay().getSelectedRow() != null && form.dyngrdDisplay().getSelectedRow().getIdentifier() instanceof InpatientEpisodeLiteVo)
			{
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient((InpatientEpisodeLiteVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
				engine.open(form.getForms().Core.BedInfoDialog);
			}
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.CANCEL_TRANSFER:
			cancelTransfer();
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.ASSIGNWARD:
			
			if( ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue() == true )	//wdev-18936
			{
				form.getGlobalContext().Core.setPatientElectiveListForWardViewVo((PatientElectiveListForWardViewVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
			}
			else
				form.getGlobalContext().Core.setPendingElectiveAdmission((PendingElectiveAdmissionAdmitVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
			
			engine.open(form.getForms().Core.AssignWard);
		break;
		default :
		break;
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void searchPlanned()
{
	if(validatePlannedSearchCriteria())
	{
		form.lyrAdmission().tabPlanned().grdTCI().getRows().clear();
		
		PendingElectiveAdmissionAdmitVoCollection voCollPlanned = null;
		BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
		if(voBed != null)
			voCollPlanned = domain.listPlannedElectiveAdmission(form.lyrAdmission().tabPlanned().dteFrom().getValue(), form.lyrAdmission().tabPlanned().dteTo().getValue(), voBed.getWard());
		else
			throw new CodingRuntimeException("Ward has not been set for bed in configuration");
		
		if(voCollPlanned == null || voCollPlanned.size() == 0)
		{
			engine.showMessage("No records found.");	//wdev-11257
			return;
		}
		
		for (PendingElectiveAdmissionAdmitVo voPlannedAdmission : voCollPlanned)
		{
			grdTCIRow row = form.lyrAdmission().tabPlanned().grdTCI().getRows().newRow();
			
			PatientShort voPatient = (voPlannedAdmission.getPasEventIsNotNull() && voPlannedAdmission.getPasEvent().getPatientIsNotNull()) ? voPlannedAdmission.getPasEvent().getPatient() : null;
			if(voPatient != null)
			{
				if(voPatient.getNameIsNotNull())
				{
					row.setColForename(voPatient.getName().getForename());
					row.setColSurname(voPatient.getName().getSurname());
				}
				
				PatientId patId = voPatient.getDisplayId();
				row.setColDisplayId(patId != null ? patId.getValue() : null);
				row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
				
				Integer age = voPatient.calculateAge();
				if(age != null)
					row.setColAge(String.valueOf(age));
				
				row.setColDob(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
				
				if(voPatient.getAssociatedPatientIsNotNull())		//wdev-13105
					row.setBackColor(ConfigFlag.UI.MERGED_COLOUR.getValue());
				
				if(voPatient.getDodIsNotNull())					//wdev-13105
					row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue());
			}
			row.setValue(voPlannedAdmission);
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateBookedTabFromData() 
{
	form.getLocalContext().setRecordSelected(false);
	form.lyrAdmission().tabBooked().grdElective().getRows().clear();
	
	PendingElectiveAdmissionAdmitVoCollection voCollPendingElectiveAdmission = null;
	BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
	if(voBed != null)
	{
		
		voCollPendingElectiveAdmission = domain.listPendingElectiveAdmission( voBed.getWard() );
		if(voCollPendingElectiveAdmission == null || voCollPendingElectiveAdmission.size() == 0)
			return;
	}
	
	if(voCollPendingElectiveAdmission == null)
		return;
	
	for(PendingElectiveAdmissionAdmitVo voPendingElectiveAdmission : voCollPendingElectiveAdmission)
	{
		grdElectiveRow row = form.lyrAdmission().tabBooked().grdElective().getRows().newRow();
		
		PatientShort voPatient = (voPendingElectiveAdmission.getPasEventIsNotNull() && voPendingElectiveAdmission.getPasEvent().getPatientIsNotNull()) ? voPendingElectiveAdmission.getPasEvent().getPatient() : null;
		if(voPatient != null)
		{
			if(voPatient.getNameIsNotNull())
			{
				row.setColForename(voPatient.getName().getForename());
				row.setColSurname(voPatient.getName().getSurname());
			}
			
			PatientId patId = voPatient.getDisplayId();
			row.setColDisplayId(patId != null ? patId.getValue() : null);
			row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
			
			Integer age = voPatient.calculateAge();
			if(age != null)
				row.setColAge(String.valueOf(age));
			
			row.setColDOB(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
			
			if(voPatient.getAssociatedPatientIsNotNull())	//wdev-13105
				row.setBackColor(ConfigFlag.UI.MERGED_COLOUR.getValue());
			
			if(voPatient.getDodIsNotNull())		//wdev-13105
				row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue());		
		}
		row.setValue(voPendingElectiveAdmission);
	}
	
	form.fireCustomControlValueChanged();
}
 
Example 10
Project: AvoinApotti   File: AssignWardImpl.java   Source Code and License 4 votes vote down vote up
/**
 * update booklist entry on PAS and then save locally if successful
 */
public void savePendingElectiveAdmission(PendingElectiveAdmissionAdmitVo pendingElective) throws DomainInterfaceException, StaleObjectException
{
	if (pendingElective == null)
		throw new CodingRuntimeException("pendingElective is null in method savePendingElectiveAdmission");
	if (!pendingElective.isValidated())
		throw new CodingRuntimeException("pendingElective has not been validated in method savePendingElectiveAdmission");

	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission doPendingElective = PendingElectiveAdmissionAdmitVoAssembler.extractPendingElectiveAdmission(factory, pendingElective);

	BooklistRecord dtoBooklist = null;
	ims.dto.client.Booklist booklistRec = null;
	try
	{
		booklistRec = (ims.dto.client.Booklist) getDTOInstance(ims.dto.client.Booklist.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	booklistRec.Filter.clear();
	if(pendingElective.getPasEventIsNotNull() && pendingElective.getPasEvent().getPatientIsNotNull())
	{
		ims.core.vo.PatientId intfId = pendingElective.getPasEvent().getPatient().getHospnum();
		Result result = null;
		if (intfId != null)
			booklistRec.Filter.Hospnum = intfId.getValue();
		else
			throw new DomainRuntimeException("No valid Interface Patient Identifier supplied.");
		
		if(doPendingElective.getTCITime() != null)
			booklistRec.Filter.Time = DTOHelper.convertToDtoTime(doPendingElective.getTCITime());
		else
			throw new CodingRuntimeException("No valid TCI Time supplied.");
		
		if(doPendingElective.getTCIDate() != null)
			booklistRec.Filter.Date = DTOHelper.convertToDtoDate(doPendingElective.getTCIDate());
		else
			throw new CodingRuntimeException("No valid TCI Date supplied.");
		
		result = booklistRec.get();
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
		
		dtoBooklist = booklistRec.DataCollection.get(0);
		if(doPendingElective.getAllocatedWard() == null)
			throw new CodingRuntimeException("Allocated Ward not set");
			
		dtoBooklist.Rescode = doPendingElective.getAllocatedWard().getExtCode(TaxonomyType.PAS.getID());
		dtoBooklist.Webadt = "Y";
		
		result = booklistRec.update();
		
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to save to Pas failed " + result.getMessage());
	}
	
	factory.save(doPendingElective);
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException
{
	switch (menuItemID)
	{
		case GenForm.ContextMenus.CoreNamespace.WardView.TRANSFER:
			form.getGlobalContext().Core.setSelectedBedSpaceState(null);
			form.getGlobalContext().Core.setBedInfoAction(BedInfoAction.TRANSFERWAITINGAREAPATIENT); 
			if(form.dyngrdDisplay().getSelectedRow() != null && form.dyngrdDisplay().getSelectedRow().getIdentifier() instanceof InpatientEpisodeLiteVo)
			{
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient((InpatientEpisodeLiteVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
				engine.open(form.getForms().Core.BedInfoDialog);
			}
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.DISCHARGE:
			form.getGlobalContext().Core.setSelectedBedSpaceState(null);
			form.getGlobalContext().Core.setBedInfoAction(BedInfoAction.DISCHARGEWAITINGAREAPATIENT); 
			if(form.dyngrdDisplay().getSelectedRow() != null && form.dyngrdDisplay().getSelectedRow().getIdentifier() instanceof InpatientEpisodeLiteVo)
			{
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient((InpatientEpisodeLiteVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
				engine.open(form.getForms().Core.BedInfoDialog);
			}
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.CANCEL_TRANSFER:
			cancelTransfer();
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.ASSIGNWARD:
			
			if( ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue() == true )	//wdev-18936
			{
				form.getGlobalContext().Core.setPatientElectiveListForWardViewVo((PatientElectiveListForWardViewVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
			}
			else
				form.getGlobalContext().Core.setPendingElectiveAdmission((PendingElectiveAdmissionAdmitVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
			
			engine.open(form.getForms().Core.AssignWard);
		break;
		default :
		break;
	}
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void searchPlanned()
{
	if(validatePlannedSearchCriteria())
	{
		form.lyrAdmission().tabPlanned().grdTCI().getRows().clear();
		
		PendingElectiveAdmissionAdmitVoCollection voCollPlanned = null;
		BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
		if(voBed != null)
			voCollPlanned = domain.listPlannedElectiveAdmission(form.lyrAdmission().tabPlanned().dteFrom().getValue(), form.lyrAdmission().tabPlanned().dteTo().getValue(), voBed.getWard());
		else
			throw new CodingRuntimeException("Ward has not been set up with a bed configuration");
		
		if(voCollPlanned == null || voCollPlanned.size() == 0)
		{
			engine.showMessage("No records found.");	//wdev-11257
			return;
		}
		
		for (PendingElectiveAdmissionAdmitVo voPlannedAdmission : voCollPlanned)
		{
			grdTCIRow row = form.lyrAdmission().tabPlanned().grdTCI().getRows().newRow();
			
			PatientLite_IdentifiersVo voPatient = (voPlannedAdmission.getPasEventIsNotNull() && voPlannedAdmission.getPasEvent().getPatientIsNotNull()) ? voPlannedAdmission.getPasEvent().getPatient() : null;
			if(voPatient != null)
			{
				if(voPatient.getNameIsNotNull())
				{
					row.setColForename(voPatient.getName().getForename());
					row.setColSurname(voPatient.getName().getSurname());
				}
				
				PatientId patId = voPatient.getDisplayId();
				row.setColDisplayId(patId != null ? patId.getValue() : null);
				row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
				
				Integer age = voPatient.calculateAge();
				if (age != null)
					row.setColAge(voPatient.calculateAgeText());
				
				row.setColDob(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
				
				if (voPatient.getAssociatedPatientIsNotNull())		//wdev-13105
					row.setBackColor(ConfigFlag.UI.MERGED_COLOUR.getValue());
				
				if (voPatient.getDodIsNotNull())	//wdev-13105
				{	
					row.setBackColor(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS")  ? Color.Yellow : ConfigFlag.UI.RIP_COLOUR.getValue());
					row.setTooltip(getRIPInfo(voPatient));
				}	
			}
			row.setValue(voPlannedAdmission);
		}
	}
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateBookedTabFromData() 
{
	form.getLocalContext().setRecordSelected(false);
	form.lyrAdmission().tabBooked().grdElective().getRows().clear();
	
	PendingElectiveAdmissionAdmitVoCollection voCollPendingElectiveAdmission = null;
	BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
	if(voBed != null)
	{
		
		voCollPendingElectiveAdmission = domain.listPendingElectiveAdmission( voBed.getWard() );
		if(voCollPendingElectiveAdmission == null || voCollPendingElectiveAdmission.size() == 0)
			return;
	}
	
	if(voCollPendingElectiveAdmission == null)
		return;
	
	for(PendingElectiveAdmissionAdmitVo voPendingElectiveAdmission : voCollPendingElectiveAdmission)
	{
		grdElectiveRow row = form.lyrAdmission().tabBooked().grdElective().getRows().newRow();
		
		PatientLite_IdentifiersVo patient = (voPendingElectiveAdmission.getPasEventIsNotNull() && voPendingElectiveAdmission.getPasEvent().getPatientIsNotNull()) ? voPendingElectiveAdmission.getPasEvent().getPatient() : null;
		if(patient != null)
		{
			if(patient.getNameIsNotNull())
			{
				row.setColForename(patient.getName().getForename());
				row.setColSurname(patient.getName().getSurname());
			}
			
			PatientId patId = patient.getDisplayId();
			row.setColDisplayId(patId != null ? patId.getValue() : null);
			row.setColSex(patient.getSexIsNotNull() ? patient.getSex().toString() : null);
			
			Integer age = patient.calculateAge();
			if(age != null)
				row.setColAge(patient.calculateAgeText());
			
			row.setColDOB(patient.getDobIsNotNull() ? patient.getDob().toString() : null);
			
			if (patient.getAssociatedPatientIsNotNull())	//wdev-13105
				row.setBackColor(ConfigFlag.UI.MERGED_COLOUR.getValue());
			
			if (patient.getDodIsNotNull())		//wdev-13105
			{	
				row.setBackColor(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS")  ? Color.Yellow : ConfigFlag.UI.RIP_COLOUR.getValue());
				row.setTooltip(getRIPInfo(patient));
			}	
				
		}
		row.setValue(voPendingElectiveAdmission);
	}
	
	form.fireCustomControlValueChanged();
}
 
Example 14
Project: openMAXIMS   File: AssignWardImpl.java   Source Code and License 4 votes vote down vote up
/**
 * update booklist entry on PAS and then save locally if successful
 */
public void savePendingElectiveAdmission(PendingElectiveAdmissionAdmitVo pendingElective) throws DomainInterfaceException, StaleObjectException
{
	if (pendingElective == null)
		throw new CodingRuntimeException("pendingElective is null in method savePendingElectiveAdmission");
	if (!pendingElective.isValidated())
		throw new CodingRuntimeException("pendingElective has not been validated in method savePendingElectiveAdmission");

	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission doPendingElective = PendingElectiveAdmissionAdmitVoAssembler.extractPendingElectiveAdmission(factory, pendingElective);

	BooklistRecord dtoBooklist = null;
	ims.dto.client.Booklist booklistRec = null;
	try
	{
		booklistRec = (ims.dto.client.Booklist) getDTOInstance(ims.dto.client.Booklist.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	booklistRec.Filter.clear();
	if(pendingElective.getPasEventIsNotNull() && pendingElective.getPasEvent().getPatientIsNotNull())
	{
		ims.core.vo.PatientId intfId = pendingElective.getPasEvent().getPatient().getHospnum();
		Result result = null;
		if (intfId != null)
			booklistRec.Filter.Hospnum = intfId.getValue();
		else
			throw new DomainRuntimeException("No valid Interface Patient Identifier supplied.");
		
		if(doPendingElective.getTCITime() != null)
			booklistRec.Filter.Time = DTOHelper.convertToDtoTime(doPendingElective.getTCITime());
		else
			throw new CodingRuntimeException("No valid TCI Time supplied.");
		
		if(doPendingElective.getTCIDate() != null)
			booklistRec.Filter.Date = DTOHelper.convertToDtoDate(doPendingElective.getTCIDate());
		else
			throw new CodingRuntimeException("No valid TCI Date supplied.");
		
		result = booklistRec.get();
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
		
		dtoBooklist = booklistRec.DataCollection.get(0);
		if(doPendingElective.getAllocatedWard() == null)
			throw new CodingRuntimeException("Allocated Ward not set");
			
		dtoBooklist.Rescode = doPendingElective.getAllocatedWard().getExtCode(TaxonomyType.PAS.getID());
		dtoBooklist.Webadt = "Y";
		
		result = booklistRec.update();
		
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to save to Pas failed " + result.getMessage());
	}
	
	factory.save(doPendingElective);
}
 
Example 15
Project: openMAXIMS   File: AdmitToWardImpl.java   Source Code and License 4 votes vote down vote up
public Boolean saveAdmissionAndUpdateList(AdmissionDetailVo admissionDetail, WardStayVo wardStay, ConsultantStayVo consultantStay, CareSpellAdmitVo careSpell, CatsReferralEmergencyAdmissionVo referral, Object selectedAdmissionData, PatientCaseNoteTransferVoCollection caseNoteTransfers) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException
	{
//		AdmissionDetail domAdmissionDetail = AdmissionDetailShortVoAssembler.extractAdmissionDetail(getDomainFactory(), admissionDetail);
//		getDomainFactory().save(domAdmissionDetail);
		
//		AdmissionDetailVo admissionDetails = AdmissionDetailVoAssembler.create(domAdmissionDetail);
//		admissionDetails.validate();
		

		PendingElectiveAdmissionAdmitVo pendingBookedElectiveAdmission = selectedAdmissionData instanceof PendingElectiveAdmissionAdmitVo ? (PendingElectiveAdmissionAdmitVo) selectedAdmissionData : null;
		PendingEmergencyAdmissionAdmitVo pendingEDEmergency = selectedAdmissionData instanceof PendingEmergencyAdmissionAdmitVo ? (PendingEmergencyAdmissionAdmitVo) selectedAdmissionData : null;
		PendingElectiveAdmissionAdmitVo pendingElectiveAdmission = selectedAdmissionData instanceof PendingElectiveAdmissionAdmitVo ? (PendingElectiveAdmissionAdmitVo) selectedAdmissionData : null;
		CatsReferralPendingEmergencyNonEDAdmissionListVo pendingEmergencyAdmission = selectedAdmissionData instanceof CatsReferralPendingEmergencyNonEDAdmissionListVo ? (CatsReferralPendingEmergencyNonEDAdmissionListVo) selectedAdmissionData : null;

		
		PatientElectiveListBedAdmissionVo patientTCI_ElectiveList = selectedAdmissionData instanceof PatientElectiveListBedAdmissionVo ? (PatientElectiveListBedAdmissionVo) selectedAdmissionData : null;
		
		AdmissionType admissionType = AdmissionType.EMERGENCY;
		
		
		BedAdmissionComponent impl = (BedAdmissionComponent) getDomainImpl(BedAdmissionComponentImpl.class);

		if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue()) && selectedAdmissionData instanceof PatientElectiveListBedAdmissionVo)
		{
			PatientElectiveListBedAdmissionVo electiveAdmission = impl.saveTCIAdmissionAndUpdateList(patientTCI_ElectiveList, null, wardStay, consultantStay, null, null, null, caseNoteTransfers);
			
			impl.createCaseNoteRequests(electiveAdmission);
		}
//		else if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue()) && selectedAdmissionData instanceof PatientLite_IdentifiersVo)
//		{
//			CareSpellVo careSpell = createCareSpell((PatientLite_IdentifiersVo) selectedAdmissionData, admissionDetail.getPasEvent(), admissionDetail.getAdmissionDateTime(), admissionDetail.getConsultant(), admissionDetail.getService());
//			CatsReferralEmergencyAdmissionVo catsReferral = createCatsReferral((PatientLite_IdentifiersVo) selectedAdmissionData, admissionDetail, careSpell);
//			
//			impl.saveEmergencyAdmissionInElectiveCase(admissionDetail,				// Admission Detail 
//													  careSpell,					// Care Spell
//													  catsReferral,					// Cats Referral
//													  null,							// Bed Space State - null when Admitting to Ward
//													  wardStay,						// Ward Stay
//													  consultantStay,				// Consultant Stay
//													  null,							// Admission Reason 
//													  null,							// Ward Mixed Sex Breach 
//													  null,							// Ward Bay Config
//													  caseNoteTransfers);			// Patient Case Note Transfer
//		}
		else
		{
			impl.saveAdmissionAndUpdateList(admissionDetail,						// Admission Detail
											null,									// Bed Space State - null when Admitting to Ward
											careSpell,
											referral,
											wardStay,								// Ward Stay
											consultantStay,							// Consultant Stay
											pendingBookedElectiveAdmission,			// Pending Elective Admission - Planned (Booked)
											pendingEDEmergency,						// Pending Emergency Admission - ED
											pendingElectiveAdmission,				// Pending Elective Admission - (TCI)
											pendingEmergencyAdmission,				// Pending Emergency Admission - Non ED
											admissionType,							// Admission Type
											null,									// Admission Reason
											null,									// Ward Mixed Sex Breach
											null,									// Ward Bay Config
											caseNoteTransfers);						// Patient Case Note Transfer
		}

		//WDEV-21973 make sure patient has a Case Note Folder
		impl.createCaseNoteFolderIfNone(admissionDetail.getPasEvent().getPatient());
		
		return true;
	}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException
{
	switch (menuItemID)
	{
		case GenForm.ContextMenus.CoreNamespace.WardView.TRANSFER:
			form.getGlobalContext().Core.setSelectedBedSpaceState(null);
			form.getGlobalContext().Core.setBedInfoAction(BedInfoAction.TRANSFERWAITINGAREAPATIENT); 
			if(form.dyngrdDisplay().getSelectedRow() != null && form.dyngrdDisplay().getSelectedRow().getIdentifier() instanceof InpatientEpisodeLiteVo)
			{
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient((InpatientEpisodeLiteVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
				engine.open(form.getForms().Core.BedInfoDialog);
			}
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.DISCHARGE:
			form.getGlobalContext().Core.setSelectedBedSpaceState(null);
			form.getGlobalContext().Core.setBedInfoAction(BedInfoAction.DISCHARGEWAITINGAREAPATIENT); 
			if(form.dyngrdDisplay().getSelectedRow() != null && form.dyngrdDisplay().getSelectedRow().getIdentifier() instanceof InpatientEpisodeLiteVo)
			{
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient((InpatientEpisodeLiteVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
				engine.open(form.getForms().Core.BedInfoDialog);
			}
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.CANCEL_TRANSFER:
			cancelTransfer();
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.ASSIGNWARD:
			
			if( ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue() == true )	//wdev-18936
			{
				form.getGlobalContext().Core.setPatientElectiveListForWardViewVo((PatientElectiveListForWardViewVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
			}
			else
				form.getGlobalContext().Core.setPendingElectiveAdmission((PendingElectiveAdmissionAdmitVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
			
			engine.open(form.getForms().Core.AssignWard);
		break;
		default :
		break;
	}
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void searchPlanned()
{
	if(validatePlannedSearchCriteria())
	{
		form.lyrAdmission().tabPlanned().grdTCI().getRows().clear();
		
		PendingElectiveAdmissionAdmitVoCollection voCollPlanned = null;
		BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
		if(voBed != null)
			voCollPlanned = domain.listPlannedElectiveAdmission(form.lyrAdmission().tabPlanned().dteFrom().getValue(), form.lyrAdmission().tabPlanned().dteTo().getValue(), voBed.getWard());
		else
			throw new CodingRuntimeException("Ward has not been set for bed in configuration");
		
		if(voCollPlanned == null || voCollPlanned.size() == 0)
		{
			engine.showMessage("No records found.");	//wdev-11257
			return;
		}
		
		for (PendingElectiveAdmissionAdmitVo voPlannedAdmission : voCollPlanned)
		{
			grdTCIRow row = form.lyrAdmission().tabPlanned().grdTCI().getRows().newRow();
			
			PatientShort voPatient = (voPlannedAdmission.getPasEventIsNotNull() && voPlannedAdmission.getPasEvent().getPatientIsNotNull()) ? voPlannedAdmission.getPasEvent().getPatient() : null;
			if(voPatient != null)
			{
				if(voPatient.getNameIsNotNull())
				{
					row.setColForename(voPatient.getName().getForename());
					row.setColSurname(voPatient.getName().getSurname());
				}
				
				PatientId patId = voPatient.getDisplayId();
				row.setColDisplayId(patId != null ? patId.getValue() : null);
				row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
				
				Integer age = voPatient.calculateAge();
				if(age != null)
					row.setColAge(String.valueOf(age));
				
				row.setColDob(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
				
				if(voPatient.getAssociatedPatientIsNotNull())		//wdev-13105
					row.setBackColor(ConfigFlag.UI.MERGED_COLOUR.getValue());
				
				if(voPatient.getDodIsNotNull())					//wdev-13105
					row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue());
			}
			row.setValue(voPlannedAdmission);
		}
	}
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateBookedTabFromData() 
{
	form.getLocalContext().setRecordSelected(false);
	form.lyrAdmission().tabBooked().grdElective().getRows().clear();
	
	PendingElectiveAdmissionAdmitVoCollection voCollPendingElectiveAdmission = null;
	BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
	if(voBed != null)
	{
		
		voCollPendingElectiveAdmission = domain.listPendingElectiveAdmission( voBed.getWard() );
		if(voCollPendingElectiveAdmission == null || voCollPendingElectiveAdmission.size() == 0)
			return;
	}
	
	if(voCollPendingElectiveAdmission == null)
		return;
	
	for(PendingElectiveAdmissionAdmitVo voPendingElectiveAdmission : voCollPendingElectiveAdmission)
	{
		grdElectiveRow row = form.lyrAdmission().tabBooked().grdElective().getRows().newRow();
		
		PatientShort voPatient = (voPendingElectiveAdmission.getPasEventIsNotNull() && voPendingElectiveAdmission.getPasEvent().getPatientIsNotNull()) ? voPendingElectiveAdmission.getPasEvent().getPatient() : null;
		if(voPatient != null)
		{
			if(voPatient.getNameIsNotNull())
			{
				row.setColForename(voPatient.getName().getForename());
				row.setColSurname(voPatient.getName().getSurname());
			}
			
			PatientId patId = voPatient.getDisplayId();
			row.setColDisplayId(patId != null ? patId.getValue() : null);
			row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
			
			Integer age = voPatient.calculateAge();
			if(age != null)
				row.setColAge(String.valueOf(age));
			
			row.setColDOB(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
			
			if(voPatient.getAssociatedPatientIsNotNull())	//wdev-13105
				row.setBackColor(ConfigFlag.UI.MERGED_COLOUR.getValue());
			
			if(voPatient.getDodIsNotNull())		//wdev-13105
				row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue());		
		}
		row.setValue(voPendingElectiveAdmission);
	}
	
	form.fireCustomControlValueChanged();
}
 
Example 19
Project: openMAXIMS   File: AssignWardImpl.java   Source Code and License 4 votes vote down vote up
/**
 * update booklist entry on PAS and then save locally if successful
 */
public void savePendingElectiveAdmission(PendingElectiveAdmissionAdmitVo pendingElective) throws DomainInterfaceException, StaleObjectException
{
	if (pendingElective == null)
		throw new CodingRuntimeException("pendingElective is null in method savePendingElectiveAdmission");
	if (!pendingElective.isValidated())
		throw new CodingRuntimeException("pendingElective has not been validated in method savePendingElectiveAdmission");

	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission doPendingElective = PendingElectiveAdmissionAdmitVoAssembler.extractPendingElectiveAdmission(factory, pendingElective);

	BooklistRecord dtoBooklist = null;
	ims.dto.client.Booklist booklistRec = null;
	try
	{
		booklistRec = (ims.dto.client.Booklist) getDTOInstance(ims.dto.client.Booklist.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	booklistRec.Filter.clear();
	if(pendingElective.getPasEventIsNotNull() && pendingElective.getPasEvent().getPatientIsNotNull())
	{
		ims.core.vo.PatientId intfId = pendingElective.getPasEvent().getPatient().getHospnum();
		Result result = null;
		if (intfId != null)
			booklistRec.Filter.Hospnum = intfId.getValue();
		else
			throw new DomainRuntimeException("No valid Interface Patient Identifier supplied.");
		
		if(doPendingElective.getTCITime() != null)
			booklistRec.Filter.Time = DTOHelper.convertToDtoTime(doPendingElective.getTCITime());
		else
			throw new CodingRuntimeException("No valid TCI Time supplied.");
		
		if(doPendingElective.getTCIDate() != null)
			booklistRec.Filter.Date = DTOHelper.convertToDtoDate(doPendingElective.getTCIDate());
		else
			throw new CodingRuntimeException("No valid TCI Date supplied.");
		
		result = booklistRec.get();
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
		
		dtoBooklist = booklistRec.DataCollection.get(0);
		if(doPendingElective.getAllocatedWard() == null)
			throw new CodingRuntimeException("Allocated Ward not set");
			
		dtoBooklist.Rescode = doPendingElective.getAllocatedWard().getExtCode(TaxonomyType.PAS.getID());
		dtoBooklist.Webadt = "Y";
		
		result = booklistRec.update();
		
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to save to Pas failed " + result.getMessage());
	}
	
	factory.save(doPendingElective);
}
 
Example 20
Project: openmaxims-linux   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException
{
	switch (menuItemID)
	{
		case GenForm.ContextMenus.CoreNamespace.WardView.TRANSFER:
			form.getGlobalContext().Core.setSelectedBedSpaceState(null);
			form.getGlobalContext().Core.setBedInfoAction(BedInfoAction.TRANSFERWAITINGAREAPATIENT); 
			if(form.dyngrdDisplay().getSelectedRow() != null && form.dyngrdDisplay().getSelectedRow().getIdentifier() instanceof InpatientEpisodeLiteVo)
			{
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient((InpatientEpisodeLiteVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
				engine.open(form.getForms().Core.BedInfoDialog);
			}
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.DISCHARGE:
			form.getGlobalContext().Core.setSelectedBedSpaceState(null);
			form.getGlobalContext().Core.setBedInfoAction(BedInfoAction.DISCHARGEWAITINGAREAPATIENT); 
			if(form.dyngrdDisplay().getSelectedRow() != null && form.dyngrdDisplay().getSelectedRow().getIdentifier() instanceof InpatientEpisodeLiteVo)
			{
				form.getGlobalContext().Core.setSelectedWaitingAreaPatient((InpatientEpisodeLiteVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
				engine.open(form.getForms().Core.BedInfoDialog);
			}
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.CANCEL_TRANSFER:
			cancelTransfer();
		break;
		case GenForm.ContextMenus.CoreNamespace.WardView.ASSIGNWARD:
			
			if( ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue() == true )	//wdev-18936
			{
				form.getGlobalContext().Core.setPatientElectiveListForWardViewVo((PatientElectiveListForWardViewVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
			}
			else
				form.getGlobalContext().Core.setPendingElectiveAdmission((PendingElectiveAdmissionAdmitVo) form.dyngrdDisplay().getSelectedRow().getIdentifier());
			
			engine.open(form.getForms().Core.AssignWard);
		break;
		default :
		break;
	}
}
 
Example 21
Project: openmaxims-linux   File: Logic.java   Source Code and License 4 votes vote down vote up
private void searchPlanned()
{
	if(validatePlannedSearchCriteria())
	{
		form.lyrAdmission().tabPlanned().grdTCI().getRows().clear();
		
		PendingElectiveAdmissionAdmitVoCollection voCollPlanned = null;
		BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
		if(voBed != null)
			voCollPlanned = domain.listPlannedElectiveAdmission(form.lyrAdmission().tabPlanned().dteFrom().getValue(), form.lyrAdmission().tabPlanned().dteTo().getValue(), voBed.getWard());
		else
			throw new CodingRuntimeException("Ward has not been set for bed in configuration");
		
		if(voCollPlanned == null || voCollPlanned.size() == 0)
		{
			engine.showMessage("No records found.");	//wdev-11257
			return;
		}
		
		for (PendingElectiveAdmissionAdmitVo voPlannedAdmission : voCollPlanned)
		{
			grdTCIRow row = form.lyrAdmission().tabPlanned().grdTCI().getRows().newRow();
			
			PatientShort voPatient = (voPlannedAdmission.getPasEventIsNotNull() && voPlannedAdmission.getPasEvent().getPatientIsNotNull()) ? voPlannedAdmission.getPasEvent().getPatient() : null;
			if(voPatient != null)
			{
				if(voPatient.getNameIsNotNull())
				{
					row.setColForename(voPatient.getName().getForename());
					row.setColSurname(voPatient.getName().getSurname());
				}
				
				PatientId patId = voPatient.getDisplayId();
				row.setColDisplayId(patId != null ? patId.getValue() : null);
				row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
				
				Integer age = voPatient.calculateAge();
				if(age != null)
					row.setColAge(String.valueOf(age));
				
				row.setColDob(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
				
				if(voPatient.getAssociatedPatientIsNotNull())		//wdev-13105
					row.setBackColor(ConfigFlag.UI.MERGED_COLOUR.getValue());
				
				if(voPatient.getDodIsNotNull())					//wdev-13105
					row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue());
			}
			row.setValue(voPlannedAdmission);
		}
	}
}
 
Example 22
Project: openmaxims-linux   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateBookedTabFromData() 
{
	form.getLocalContext().setRecordSelected(false);
	form.lyrAdmission().tabBooked().grdElective().getRows().clear();
	
	PendingElectiveAdmissionAdmitVoCollection voCollPendingElectiveAdmission = null;
	BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState();
	if(voBed != null)
	{
		
		voCollPendingElectiveAdmission = domain.listPendingElectiveAdmission( voBed.getWard() );
		if(voCollPendingElectiveAdmission == null || voCollPendingElectiveAdmission.size() == 0)
			return;
	}
	
	if(voCollPendingElectiveAdmission == null)
		return;
	
	for(PendingElectiveAdmissionAdmitVo voPendingElectiveAdmission : voCollPendingElectiveAdmission)
	{
		grdElectiveRow row = form.lyrAdmission().tabBooked().grdElective().getRows().newRow();
		
		PatientShort voPatient = (voPendingElectiveAdmission.getPasEventIsNotNull() && voPendingElectiveAdmission.getPasEvent().getPatientIsNotNull()) ? voPendingElectiveAdmission.getPasEvent().getPatient() : null;
		if(voPatient != null)
		{
			if(voPatient.getNameIsNotNull())
			{
				row.setColForename(voPatient.getName().getForename());
				row.setColSurname(voPatient.getName().getSurname());
			}
			
			PatientId patId = voPatient.getDisplayId();
			row.setColDisplayId(patId != null ? patId.getValue() : null);
			row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null);
			
			Integer age = voPatient.calculateAge();
			if(age != null)
				row.setColAge(String.valueOf(age));
			
			row.setColDOB(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null);
			
			if(voPatient.getAssociatedPatientIsNotNull())	//wdev-13105
				row.setBackColor(ConfigFlag.UI.MERGED_COLOUR.getValue());
			
			if(voPatient.getDodIsNotNull())		//wdev-13105
				row.setBackColor(ConfigFlag.UI.RIP_COLOUR.getValue());		
		}
		row.setValue(voPendingElectiveAdmission);
	}
	
	form.fireCustomControlValueChanged();
}
 
Example 23
Project: openmaxims-linux   File: AssignWardImpl.java   Source Code and License 4 votes vote down vote up
/**
 * update booklist entry on PAS and then save locally if successful
 */
public void savePendingElectiveAdmission(PendingElectiveAdmissionAdmitVo pendingElective) throws DomainInterfaceException, StaleObjectException
{
	if (pendingElective == null)
		throw new CodingRuntimeException("pendingElective is null in method savePendingElectiveAdmission");
	if (!pendingElective.isValidated())
		throw new CodingRuntimeException("pendingElective has not been validated in method savePendingElectiveAdmission");

	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission doPendingElective = PendingElectiveAdmissionAdmitVoAssembler.extractPendingElectiveAdmission(factory, pendingElective);

	BooklistRecord dtoBooklist = null;
	ims.dto.client.Booklist booklistRec = null;
	try
	{
		booklistRec = (ims.dto.client.Booklist) getDTOInstance(ims.dto.client.Booklist.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	booklistRec.Filter.clear();
	if(pendingElective.getPasEventIsNotNull() && pendingElective.getPasEvent().getPatientIsNotNull())
	{
		ims.core.vo.PatientId intfId = pendingElective.getPasEvent().getPatient().getHospnum();
		Result result = null;
		if (intfId != null)
			booklistRec.Filter.Hospnum = intfId.getValue();
		else
			throw new DomainRuntimeException("No valid Interface Patient Identifier supplied.");
		
		if(doPendingElective.getTCITime() != null)
			booklistRec.Filter.Time = DTOHelper.convertToDtoTime(doPendingElective.getTCITime());
		else
			throw new CodingRuntimeException("No valid TCI Time supplied.");
		
		if(doPendingElective.getTCIDate() != null)
			booklistRec.Filter.Date = DTOHelper.convertToDtoDate(doPendingElective.getTCIDate());
		else
			throw new CodingRuntimeException("No valid TCI Date supplied.");
		
		result = booklistRec.get();
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
		
		dtoBooklist = booklistRec.DataCollection.get(0);
		if(doPendingElective.getAllocatedWard() == null)
			throw new CodingRuntimeException("Allocated Ward not set");
			
		dtoBooklist.Rescode = doPendingElective.getAllocatedWard().getExtCode(TaxonomyType.PAS.getID());
		dtoBooklist.Webadt = "Y";
		
		result = booklistRec.update();
		
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to save to Pas failed " + result.getMessage());
	}
	
	factory.save(doPendingElective);
}