Java Code Examples for ims.dto.ResultException

The following are top voted examples for showing how to use ims.dto.ResultException. 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: WebPasLaunchDialogImpl.java   Source Code and License 6 votes vote down vote up
/**
* getWebPASSecurityCode
*/
public String getWebPASSecurityCode() throws DomainInterfaceException
{
	ims.dto.client.Webpas wpRec = null;
	try
	{
		wpRec = (ims.dto.client.Webpas) getDTOInstance(ims.dto.client.Webpas.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	Result result = wpRec.get();
	if(result != null && result.getId() < 0)
		throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
	
	WebpasRecord dtoWebPas = wpRec.DataCollection.get(0);
	if(dtoWebPas.Id != null)	
		return dtoWebPas.Id;
	
	return "";
}
 
Example 2
Project: openMAXIMS   File: WebPasLaunchDialogImpl.java   Source Code and License 6 votes vote down vote up
/**
* getWebPASSecurityCode
*/
public String getWebPASSecurityCode() throws DomainInterfaceException
{
	ims.dto.client.Webpas wpRec = null;
	try
	{
		wpRec = (ims.dto.client.Webpas) getDTOInstance(ims.dto.client.Webpas.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	Result result = wpRec.get();
	if(result != null && result.getId() < 0)
		throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
	
	WebpasRecord dtoWebPas = wpRec.DataCollection.get(0);
	if(dtoWebPas.Id != null)	
		return dtoWebPas.Id;
	
	return "";
}
 
Example 3
Project: openMAXIMS   File: WebPasLaunchDialogImpl.java   Source Code and License 6 votes vote down vote up
/**
* getWebPASSecurityCode
*/
public String getWebPASSecurityCode() throws DomainInterfaceException
{
	ims.dto.client.Webpas wpRec = null;
	try
	{
		wpRec = (ims.dto.client.Webpas) getDTOInstance(ims.dto.client.Webpas.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	Result result = wpRec.get();
	if(result != null && result.getId() < 0)
		throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
	
	WebpasRecord dtoWebPas = wpRec.DataCollection.get(0);
	if(dtoWebPas.Id != null)	
		return dtoWebPas.Id;
	
	return "";
}
 
Example 4
Project: openmaxims-linux   File: WebPasLaunchDialogImpl.java   Source Code and License 6 votes vote down vote up
/**
* getWebPASSecurityCode
*/
public String getWebPASSecurityCode() throws DomainInterfaceException
{
	ims.dto.client.Webpas wpRec = null;
	try
	{
		wpRec = (ims.dto.client.Webpas) getDTOInstance(ims.dto.client.Webpas.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	Result result = wpRec.get();
	if(result != null && result.getId() < 0)
		throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
	
	WebpasRecord dtoWebPas = wpRec.DataCollection.get(0);
	if(dtoWebPas.Id != null)	
		return dtoWebPas.Id;
	
	return "";
}
 
Example 5
Project: openMAXIMS   File: CaseNoteTrackingImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.CaseNoteFolderVo saveCaseNote(ims.core.vo.CaseNoteFolderVo voCaseNote) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
	Casenote cnRec = null;
	try
	{
		cnRec = (Casenote) getDTOInstance(Casenote.class);
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	cnRec.DataCollection.add();
	CasenoteRecord dtoCN = cnRec.DataCollection.get(0);

	dtoCN.Vol = voCaseNote.getVolume();
	dtoCN.Curr_loc = voCaseNote.getLocation();
	dtoCN.Move_to = voCaseNote.getMoveTo();
	dtoCN.Loc_date = voCaseNote.getLocDate().toString(DateFormat.ISO);
	dtoCN.Loc_time = voCaseNote.getLocTime().toString(TimeFormat.FLAT6);
	dtoCN.Comm = voCaseNote.getComments();
	dtoCN.Unam = voCaseNote.getUNAM();
	dtoCN.Rdat = voCaseNote.getRDAT().toString(DateFormat.ISO);
	dtoCN.Rtim = voCaseNote.getRTIM().toString(TimeFormat.FLAT6);
	dtoCN.Hospnum = voCaseNote.getHOSPNUM();
	
	Result result = cnRec.update();
	if(result != null && result.getId() < 0)
		throw new DomainInterfaceException("Attempt to save to CaseNote failed " + result.getMessage());
	
	return null;
}
 
Example 6
Project: openMAXIMS   File: CaseNoteTransferDialogImpl.java   Source Code and License 5 votes vote down vote up
public String[] listLocation(String szSearchString)
{
	Rsfhearts rsfRec = null;
	try
	{
		rsfRec = (Rsfhearts) getDTOInstance(Rsfhearts.class);
	}
	catch(ResultException e)
	{
		throw new DomainRuntimeException("Failed to Connect to PAS - Please check Configuration");
	}
	
	rsfRec.Filter.At14 = "A";
	rsfRec.Filter.Stat = "A";
	szSearchString = szSearchString.trim();
	szSearchString = szSearchString.toUpperCase();
	rsfRec.Filter.Name = removeWildCards(szSearchString) + "?";
		
	Result result = rsfRec.list();
	if (result != null
		&& result.getId() < 0 
		&& result.getId() != -2)
		throw new DomainRuntimeException("Failed to List RsfHearts");

	ArrayList<String> strColl = new ArrayList<String>();
	if(rsfRec != null)
	{
		for(int x = 0; x < rsfRec.DataCollection.count(); x++)
			strColl.add(rsfRec.DataCollection.get(x).Name);
	}
	
	return strColl.toArray(new String[strColl.size()]);
}
 
Example 7
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 8
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 9
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 10
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);
}