Java Code Examples for ims.framework.enumerations.SystemLogType

The following are top voted examples for showing how to use ims.framework.enumerations.SystemLogType. 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
public void clear()
{
	if (form.getGlobalContext().Core.getPatientPhotoTempFilesIsNotNull() &&
			form.getGlobalContext().Core.getPatientPhotoTempFiles().size() > 0)			
	{
		for (String filePath : form.getGlobalContext().Core.getPatientPhotoTempFiles()) {
			
			File file = new File(filePath);
			boolean deleteFile = file.delete();				
			if (deleteFile) {
				engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.INFORMATION, "File " + filePath + " was deleted!");
			}
			else {
				engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.INFORMATION, "File " + filePath + " cannot be deleted!");
			}
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private byte[] readFile(String finalPDF) throws FileNotFoundException, IOException 
{
	File pdf = new File(finalPDF);
	long size = pdf.length();
	
	if (size == 0) {
		engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.ERROR, "Size of final PDF " + finalPDF+ " is zero!");
		return null;
	}
	
	FileInputStream fileInputStream = new FileInputStream(pdf);								
	int bytesAvailable = fileInputStream.available();
	int maxBufferSize = (int) size;
	int bufferSize = Math.min(bytesAvailable, maxBufferSize);
	byte[] buffer = new byte[bufferSize];
	int bytesRead = fileInputStream.read(buffer, 0, bufferSize);
	while (bytesRead > 0)
	{					
	    bytesAvailable = fileInputStream.available();
	    bufferSize = Math.min(bytesAvailable, maxBufferSize);
	    bytesRead = fileInputStream.read(buffer, 0, bufferSize);
	}
	fileInputStream.close();		
	return buffer;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnRestartClick() throws ims.framework.exceptions.PresentationLogicException
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		controller.shutdown();
		Thread.sleep(1000); // Sleep for 1 second before starting
		controller.startup();
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.INFORMATION, "Patient Merge Servlet Restarted as requested");
		Thread.sleep(200);  // Before refresh
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to restart PatientMerge Servlet - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to restart PatientMerge Servlet - " + e.getMessage());
	}
	refreshServletTab();
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnStopClick() throws ims.framework.exceptions.PresentationLogicException
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		controller.shutdown();
		Thread.sleep(200);  // Before refresh

	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to stop PatientMerge Servlet - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to stop PatientMerge Servlet - " + e.getMessage());
	}
	refreshServletTab();
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnStartClick() throws ims.framework.exceptions.PresentationLogicException
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		controller.startup();
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.INFORMATION, "Patient Merge Servlet Started as requested");
		Thread.sleep(200);  // Before refresh
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to start PatientMerge Servlet - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to start PatientMerge Servlet - " + e.getMessage());
	}
	refreshServletTab();
	
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getNoSuccess()
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		if (controller != null)
		{
			IPatMergeInterfaceComponent comp = controller.getPatMerge();
			return String.valueOf(comp.getSuccessfulCount());
		}
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to retrieve Num Successful Merges - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to retrieve Num Successful Merges - " + e.getMessage());
		return "Not Available";
	}	
	return "Not Available";
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getNoFailed()
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		if (controller != null)
		{
			IPatMergeInterfaceComponent comp = controller.getPatMerge();
		
			return String.valueOf(comp.getErrorCount());
		}
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to retrieve Num Failed Merges - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to retrieve Num Failed Merges - " + e.getMessage());
		return "Not Available";
	}
	return "Not Available";
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected Boolean isServletRunning()
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		if (controller != null)
			return(controller.isRunning());
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to retrieve PatientMerge Servlet Status - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to retrieve PatientMerge Servlet Status - " + e.getMessage());
		return null;
	}
	return null;
}
 
Example 9
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 6 votes vote down vote up
private String getNatSpecialtyCode(Service service) 
{
	if (service == null)
	{
		super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "No Service found for referral");
		return null;
	}
			
	if (service.getTaxonomyMap() == null || service.getTaxonomyMap().size() == 0)
	{
		super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "No TaxonomyTypes found for this service - " + service.getServiceName());
		return null;
	}
	
	for (int i=0; i<service.getTaxonomyMap().size(); i++)
	{
		TaxonomyMap taxMap = (TaxonomyMap) service.getTaxonomyMap().get(i);
		if (taxMap.getTaxonomyName().getId() == TaxonomyType.NAT_SPEC_CODE.getId())
			return taxMap.getTaxonomyCode();
	}
	
	super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "TaxonomyType NAT_SPEC_CODE not found for this service - " + service.getServiceName());
	return null;
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open() 
{
	try 
	{			
		if (checkForExistingUserLDAPCredentials())
		{				
			if (authenticateWithLDAP(form.getLocalContext().getLDAPUsername(), form.getLocalContext().getLDAPPassword()))
			{					
				launchEvolve();			
			}				
		}
		else
		{
			engine.open(form.getForms().Admin.LDAPLogin, new Object[]{domain.getLoggedInUser()});
		}
	}
	catch (Exception e) 
	{	
		engine.createSystemLogEntry(SystemLogType.INTEGRATION_ENGINE, SystemLogLevel.ERROR, e.getMessage());
		engine.showMessage(e.getMessage(), "Error", MessageButtons.OK, MessageIcon.ERROR);				
		
		return;
	}		
}
 
Example 11
Project: AvoinApotti   File: DeployReportsImpl.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public String getSiteName() 
{
	DomainFactory factory = getDomainFactory();	
	
	List list = factory.find("from AppSite");
	

	if(list.size() > 1)
	{
		createSystemLogEntry(SystemLogType.REPORTS, SystemLogLevel.ERROR, "There is more than 1 record in core_appsite table !");
		throw new ims.domain.exceptions.DomainRuntimeException("There is more than 1 record in core_appsite table !");
	}
	
	if(list.size() == 1)
	{
		AppSite appSite = (AppSite) list.get(0);
		
		if(appSite != null && appSite.getSite() != null)
			return appSite.getSite().getText();
	}
	
	return "";
}
 
Example 12
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private byte[] readFile(String finalPDF) throws FileNotFoundException, IOException 
{
	File pdf = new File(finalPDF);
	long size = pdf.length();
	
	if (size == 0) {
		engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.ERROR, "Size of final PDF " + finalPDF+ " is zero!");
		return null;
	}
	
	FileInputStream fileInputStream = new FileInputStream(pdf);								
	int bytesAvailable = fileInputStream.available();
	int maxBufferSize = (int) size;
	int bufferSize = Math.min(bytesAvailable, maxBufferSize);
	byte[] buffer = new byte[bufferSize];
	int bytesRead = fileInputStream.read(buffer, 0, bufferSize);
	while (bytesRead > 0)
	{					
	    bytesAvailable = fileInputStream.available();
	    bufferSize = Math.min(bytesAvailable, maxBufferSize);
	    bytesRead = fileInputStream.read(buffer, 0, bufferSize);
	}
	fileInputStream.close();		
	return buffer;
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public void clear()
{
	if (form.getGlobalContext().Core.getPatientPhotoTempFilesIsNotNull() &&
			form.getGlobalContext().Core.getPatientPhotoTempFiles().size() > 0)			
	{
		for (String filePath : form.getGlobalContext().Core.getPatientPhotoTempFiles()) {
			
			File file = new File(filePath);
			boolean deleteFile = file.delete();				
			if (deleteFile) {
				engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.INFORMATION, "File " + filePath + " was deleted!");
			}
			else {
				engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.INFORMATION, "File " + filePath + " cannot be deleted!");
			}
		}
	}
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private byte[] readFile(String finalPDF) throws FileNotFoundException, IOException 
{
	File pdf = new File(finalPDF);
	long size = pdf.length();
	
	if (size == 0) {
		engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.ERROR, "Size of final PDF " + finalPDF+ " is zero!");
		return null;
	}
	
	FileInputStream fileInputStream = new FileInputStream(pdf);								
	int bytesAvailable = fileInputStream.available();
	int maxBufferSize = (int) size;
	int bufferSize = Math.min(bytesAvailable, maxBufferSize);
	byte[] buffer = new byte[bufferSize];
	int bytesRead = fileInputStream.read(buffer, 0, bufferSize);
	while (bytesRead > 0)
	{					
	    bytesAvailable = fileInputStream.available();
	    bufferSize = Math.min(bytesAvailable, maxBufferSize);
	    bytesRead = fileInputStream.read(buffer, 0, bufferSize);
	}
	fileInputStream.close();		
	return buffer;
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnRestartClick() throws ims.framework.exceptions.PresentationLogicException
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		controller.shutdown();
		Thread.sleep(1000); // Sleep for 1 second before starting
		controller.startup();
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.INFORMATION, "Patient Merge Servlet Restarted as requested");
		Thread.sleep(200);  // Before refresh
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to restart PatientMerge Servlet - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to restart PatientMerge Servlet - " + e.getMessage());
	}
	refreshServletTab();
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnStopClick() throws ims.framework.exceptions.PresentationLogicException
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		controller.shutdown();
		Thread.sleep(200);  // Before refresh

	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to stop PatientMerge Servlet - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to stop PatientMerge Servlet - " + e.getMessage());
	}
	refreshServletTab();
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnStartClick() throws ims.framework.exceptions.PresentationLogicException
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		controller.startup();
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.INFORMATION, "Patient Merge Servlet Started as requested");
		Thread.sleep(200);  // Before refresh
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to start PatientMerge Servlet - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to start PatientMerge Servlet - " + e.getMessage());
	}
	refreshServletTab();
	
}
 
Example 18
Project: openmaxims-linux   File: DeployReportsImpl.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public String getSiteName() 
{
	DomainFactory factory = getDomainFactory();	
	
	List list = factory.find("from AppSite");
	

	if(list.size() > 1)
	{
		createSystemLogEntry(SystemLogType.REPORTS, SystemLogLevel.ERROR, "There is more than 1 record in core_appsite table !");
		throw new ims.domain.exceptions.DomainRuntimeException("There is more than 1 record in core_appsite table !");
	}
	
	if(list.size() == 1)
	{
		AppSite appSite = (AppSite) list.get(0);
		
		if(appSite != null && appSite.getSite() != null)
			return appSite.getSite().getText();
	}
	
	return "";
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getNoFailed()
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		if (controller != null)
		{
			IPatMergeInterfaceComponent comp = controller.getPatMerge();
		
			return String.valueOf(comp.getErrorCount());
		}
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to retrieve Num Failed Merges - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to retrieve Num Failed Merges - " + e.getMessage());
		return "Not Available";
	}
	return "Not Available";
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected Boolean isServletRunning()
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		if (controller != null)
			return(controller.isRunning());
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to retrieve PatientMerge Servlet Status - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to retrieve PatientMerge Servlet Status - " + e.getMessage());
		return null;
	}
	return null;
}
 
Example 21
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnStopClick() throws ims.framework.exceptions.PresentationLogicException
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		controller.shutdown();
		Thread.sleep(200);  // Before refresh

	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to stop PatientMerge Servlet - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to stop PatientMerge Servlet - " + e.getMessage());
	}
	refreshServletTab();
}
 
Example 22
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open() 
{
	try 
	{			
		if (checkForExistingUserLDAPCredentials())
		{				
			if (authenticateWithLDAP(form.getLocalContext().getLDAPUsername(), form.getLocalContext().getLDAPPassword()))
			{					
				launchEvolve();			
			}				
		}
		else
		{
			engine.open(form.getForms().Admin.LDAPLogin, new Object[]{domain.getLoggedInUser()});
		}
	}
	catch (Exception e) 
	{	
		engine.createSystemLogEntry(SystemLogType.INTEGRATION_ENGINE, SystemLogLevel.ERROR, e.getMessage());
		engine.showMessage(e.getMessage(), "Error", MessageButtons.OK, MessageIcon.ERROR);				
		
		return;
	}		
}
 
Example 23
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 6 votes vote down vote up
public PendingEmergencyAdmissionAdmitVo automaticDischarge(PendingEmergencyAdmissionRefVo pendingEmergencyAdmission, DateTime admissionDateTime, HcpLiteVo consultant) throws StaleObjectException
{
	if (pendingEmergencyAdmission == null || pendingEmergencyAdmission.getID_PendingEmergencyAdmission() == null)
		return null;

	try
	{
		Class<?> emergencyHelper = Class.forName("ims.emergency.helper.EmergencyHelper");
		IEmergencyHelper implEmergencyHelper = (IEmergencyHelper) getDomainImpl(emergencyHelper);
		return implEmergencyHelper.autoDischargeFromEmergencyTracking(pendingEmergencyAdmission, admissionDateTime, consultant);
	}
	catch (ClassNotFoundException e)
	{
		createSystemLogEntry(SystemLogType.APPLICATION, SystemLogLevel.INFORMATION, "Class 'Emergency Helper' not found when attempting to auto-discharge a PendingEmergencyAdmission form ED. This functionality might not be available in the application");

		return PendingEmergencyAdmissionAdmitVoAssembler.create((PendingEmergencyAdmission) getDomainFactory().getDomainObject(PendingEmergencyAdmission.class, pendingEmergencyAdmission.getID_PendingEmergencyAdmission()));
	}
}
 
Example 24
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getNoFailed()
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		if (controller != null)
		{
			IPatMergeInterfaceComponent comp = controller.getPatMerge();
		
			return String.valueOf(comp.getErrorCount());
		}
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to retrieve Num Failed Merges - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to retrieve Num Failed Merges - " + e.getMessage());
		return "Not Available";
	}
	return "Not Available";
}
 
Example 25
Project: openMAXIMS   File: CDSGenerateImpl.java   Source Code and License 6 votes vote down vote up
private String getNatSpecialtyCode(Service service) 
{
	if (service == null)
	{
		super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "No Service found for referral");
		return null;
	}
			
	if (service.getTaxonomyMap() == null || service.getTaxonomyMap().size() == 0)
	{
		super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "No TaxonomyTypes found for this service - " + service.getServiceName());
		return null;
	}
	
	for (int i=0; i<service.getTaxonomyMap().size(); i++)
	{
		TaxonomyMap taxMap = (TaxonomyMap) service.getTaxonomyMap().get(i);
		if (taxMap.getTaxonomyName().getId() == TaxonomyType.NAT_SPEC_CODE.getId())
			return taxMap.getTaxonomyCode();
	}
	
	super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "TaxonomyType NAT_SPEC_CODE not found for this service - " + service.getServiceName());
	return null;
}
 
Example 26
Project: openmaxims-linux   File: CDSGenerateImpl.java   Source Code and License 6 votes vote down vote up
private String getNatSpecialtyCode(Service service) 
{
	if (service == null)
	{
		super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "No Service found for referral");
		return null;
	}
			
	if (service.getTaxonomyMap() == null || service.getTaxonomyMap().size() == 0)
	{
		super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "No TaxonomyTypes found for this service - " + service.getServiceName());
		return null;
	}
	
	for (int i=0; i<service.getTaxonomyMap().size(); i++)
	{
		TaxonomyMap taxMap = (TaxonomyMap) service.getTaxonomyMap().get(i);
		if (taxMap.getTaxonomyName().getId() == TaxonomyType.NAT_SPEC_CODE.getId())
			return taxMap.getTaxonomyCode();
	}
	
	super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.WARNING, "TaxonomyType NAT_SPEC_CODE not found for this service - " + service.getServiceName());
	return null;
}
 
Example 27
Project: openMAXIMS   File: AppointmentOutcomeDialogImpl.java   Source Code and License 6 votes vote down vote up
private void undoEndOfCare(BookingAppointmentOutcomeVo appt) throws StaleObjectException, ForeignKeyViolationException
{
	CatsReferralListVo catsReferral = getCatsReferralListVo(appt);
	
	if (catsReferral != null && catsReferral.getCurrentStatus() != null && ReferralApptStatus.END_OF_CARE.equals(catsReferral.getCurrentStatus().getReferralStatus()))
	{	
		try
		{
			Class<?> referralStatusListImpl = Class.forName("ims.RefMan.domain.impl.ReferralStatusListImpl");
			IUndoEndOfTreatment impl  = (IUndoEndOfTreatment) getDomainImpl(referralStatusListImpl);
			impl.undoEndOfCare(catsReferral);
		}
		catch (ClassNotFoundException exception)
		{
			createSystemLogEntry(SystemLogType.APPLICATION, SystemLogLevel.INFORMATION, "Class 'ReferralDetailsImpl' was not found when attempting to record RTT Clock Impact of the AppointmentOutcome. This functionality might not be available in the application.");
		}
	}
	
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnRestartClick() throws ims.framework.exceptions.PresentationLogicException
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		controller.shutdown();
		Thread.sleep(1000); // Sleep for 1 second before starting
		controller.startup();
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.INFORMATION, "Patient Merge Servlet Restarted as requested");
		Thread.sleep(200);  // Before refresh
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to restart PatientMerge Servlet - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to restart PatientMerge Servlet - " + e.getMessage());
	}
	refreshServletTab();
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void traceDebug(String webServiceURL, String webServiceUsername, String webServiceParameters, String retUrl, PatientShort patient, String mrnNum) 
{
	if (Boolean.FALSE.equals(ConfigFlag.GEN.RELEASE_MODE.getValue())) {
		StringBuilder debug = new StringBuilder();
		debug.append("*** Calling Spectrum webService ***");
		debug.append(System.getProperty("line.separator"));			
		debug.append(System.getProperty("line.separator"));
		debug.append("Patient Info: " + patient.getPatientInfo());
		debug.append(System.getProperty("line.separator"));
		debug.append("MRN Number: " + mrnNum);
		debug.append(System.getProperty("line.separator"));			
		debug.append("WebService URL: " +  webServiceURL);
		debug.append(System.getProperty("line.separator"));
		debug.append("WebService Username: " +  webServiceUsername);
		debug.append(System.getProperty("line.separator"));
		debug.append("WebService Parameters: " +  webServiceParameters);
		debug.append(System.getProperty("line.separator"));
		debug.append("URL: " +  retUrl);
		engine.createSystemLogEntry(SystemLogType.APPLICATION, SystemLogLevel.INFORMATION, debug.toString());								
	}
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open() 
{
	try 
	{			
		if (checkForExistingUserLDAPCredentials())
		{				
			if (authenticateWithLDAP(form.getLocalContext().getLDAPUsername(), form.getLocalContext().getLDAPPassword()))
			{					
				launchEvolve();			
			}				
		}
		else
		{
			engine.open(form.getForms().Admin.LDAPLogin, new Object[]{domain.getLoggedInUser()});
		}
	}
	catch (Exception e) 
	{	
		engine.createSystemLogEntry(SystemLogType.INTEGRATION_ENGINE, SystemLogLevel.ERROR, e.getMessage());
		engine.showMessage(e.getMessage(), "Error", MessageButtons.OK, MessageIcon.ERROR);				
		
		return;
	}		
}
 
Example 31
Project: openMAXIMS   File: SessionGenerationHelper.java   Source Code and License 6 votes vote down vote up
private Integer generateSessionsForProfile(ProfileShortVo voProf, Date fromDate, Date toDate, DomainSession sess) throws DomainInterfaceException
{
	try
	{
		//Class<?> implClass = Class.forName("ims.scheduling.domain.impl.GenerateSessionsImpl");
		 ISessionGenerationHelper impl = (ISessionGenerationHelper) getDomainImpl("ims.scheduling.domain.impl.GenerateSessionsImpl");
		return impl.generateSessions(profile, fromDate, toDate, session);
	}
	catch (Exception e)
	{
		//Log the exception in system, should be fine
		createSystemLogEntry(SystemLogType.APPLICATION, SystemLogLevel.ERROR, "Class Cast exception has occured.Please check log file for: " + new DateTime().toString(DateTimeFormat.STANDARD, true) + " timestamp.");
	}
	
	return 0;
}
 
Example 32
Project: openMAXIMS   File: DeployReportsImpl.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public String getSiteName() 
{
	DomainFactory factory = getDomainFactory();	
	
	List list = factory.find("from AppSite");
	

	if(list.size() > 1)
	{
		createSystemLogEntry(SystemLogType.REPORTS, SystemLogLevel.ERROR, "There is more than 1 record in core_appsite table !");
		throw new ims.domain.exceptions.DomainRuntimeException("There is more than 1 record in core_appsite table !");
	}
	
	if(list.size() == 1)
	{
		AppSite appSite = (AppSite) list.get(0);
		
		if(appSite != null && appSite.getSite() != null)
			return appSite.getSite().getText();
	}
	
	return "";
}
 
Example 33
Project: openMAXIMS   File: WebServicesIntegrationImpl.java   Source Code and License 6 votes vote down vote up
public void setAppointmentConsultantCode(String sessionToken, String code)
{
	SessionData sessData = getSessionData();
	if(sessData == null) {
		createSOAPFault(SystemLogLevel.ERROR, "setAppointmentConsultantCode(): 'sessData' can't be null");
	}
	
	if (ConfigFlag.FW.DEBUG_WEB_SERVICES.getValue()) {
		String message = "Call setAppointmentConsultantCode() with parameters: ConsultantCode: " +  code;
		createSystemLogEntry(SystemLogType.WEB_SERVICE, SystemLogLevel.INFORMATION, sessData.securityTokenLaunchUsername.get(), "", message);
	}
	
	if (code == null || 
			code.trim().length() == 0) {		
				createSOAPFault(SystemLogLevel.ERROR, 
						"setAppointmentConsultantCode(): 'ConsultantCode' can't be null");
	}
	
	sessData.appointmentConsultantCode.set(code);		
}
 
Example 34
Project: openMAXIMS   File: DeployReportsImpl.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public String getSiteName() 
{
	DomainFactory factory = getDomainFactory();	
	
	List list = factory.find("from AppSite");
	

	if(list.size() > 1)
	{
		createSystemLogEntry(SystemLogType.REPORTS, SystemLogLevel.ERROR, "There is more than 1 record in core_appsite table !");
		throw new ims.domain.exceptions.DomainRuntimeException("There is more than 1 record in core_appsite table !");
	}
	
	if(list.size() == 1)
	{
		AppSite appSite = (AppSite) list.get(0);
		
		if(appSite != null && appSite.getSite() != null)
			return appSite.getSite().getText();
	}
	
	return "";
}
 
Example 35
Project: openMAXIMS   File: AdminEventImpl.java   Source Code and License 6 votes vote down vote up
private ContractServiceLocationsConfigVo getContractServiceLocConf(ContractConfig contract, Service service)
{
	try
	{
		Class<?> contractImpl = Class.forName("ims.RefMan.domain.impl.ContractConfigurationImpl");
		IContractConfigurationHelper contractConfigImpl = (IContractConfigurationHelper) getDomainImpl(contractImpl);
		
		ContractConfigRefVo contractConfig = contract != null ? new ContractConfigRefVo(contract.getId(), contract.getVersion()) : null;
		ServiceRefVo serviceConfig = service != null ? new ServiceRefVo(service.getId(), service.getVersion()) : null;
		
		return contractConfigImpl.getContractServiceLocConfByContractService(contractConfig, serviceConfig);
	}
	catch (ClassNotFoundException exception)
	{
		createSystemLogEntry(SystemLogType.APPLICATION, SystemLogLevel.INFORMATION, "Class 'ContractConfigurationImpl' was not found when attempting to record RTT Clock Impact of the AppointmentOutcome. This functionality might not be available in the application.");
		return null;
	}
}
 
Example 36
Project: openMAXIMS   File: HL7PathwayIfImpl.java   Source Code and License 6 votes vote down vote up
public void takeTargetOutOfScopeWithoutEvent(PatientJourneyTargetRefVo target, PatientPathwayJourneyRefVo journey) throws DomainInterfaceException, StaleObjectException
{
	DomainFactory factory = getDomainFactory();
	
	PatientJourneyTarget domPjt = (PatientJourneyTarget) factory.getDomainObject(PatientJourneyTarget.class, target.getID_PatientJourneyTarget());
	JourneyTargetStatus tStat = createJourneyTargetStatus(getDomLookup(PatientTargetStatus.NOTINSCOPE));
	domPjt.setCurrentStatus(tStat);
	domPjt.getStatusHistory().add(tStat);
	
	// WDEV-20636
	factory.save(domPjt);
	super.createSystemLogEntry(SystemLogType.APPLICATION, SystemLogLevel.INFORMATION, "Target " + domPjt.getPathwayTarget().getTarget().getName() + " (" + domPjt.getId() + ") set to not-in-scope");
	
	PatientPathwayJourney domJourney = (PatientPathwayJourney)factory.getDomainObject(PatientPathwayJourney.class, journey.getID_PatientPathwayJourney());

	// WDEV-20416
	// If this is a 31 or 62 day target we need to update the CatsReferral details
	updateCatsReferralTargetDates(factory, domJourney, domPjt, false);
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected Boolean isServletRunning()
{
	IPatMergeServletController controller = PatientMergeServletControllerFactory.getController();
	try 
	{
		if (controller != null)
			return(controller.isRunning());
	}
	catch (Exception e) 
	{
		engine.showMessage("Exception occurred attempting to retrieve PatientMerge Servlet Status - " + e.getMessage());
		engine.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred attempting to retrieve PatientMerge Servlet Status - " + e.getMessage());
		return null;
	}
	return null;
}
 
Example 38
Project: openMAXIMS   File: PatientJourneyImpl.java   Source Code and License 6 votes vote down vote up
/**
* WDEV-18474
        * saveCancerPathway
        */
public void saveCancerPathway(PatientPathwayJourneyRefVo journey, Date cancerPathwayDate) throws StaleObjectException
{
	if (journey == null || cancerPathwayDate == null)
		return;

	DomainFactory factory = getDomainFactory();
	
	PatientPathwayJourney domJourney = (PatientPathwayJourney)factory.getDomainObject(PatientPathwayJourney.class, journey.getID_PatientPathwayJourney());
	domJourney.setIsCancerPathway(true);
	domJourney.setCancerPathwayDate(cancerPathwayDate.getDate());
	factory.save(domJourney);
	
	// We now need to  check the referral type for the associated CatsReferral.  If it is GP, then we want the 62 day target in scope
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("journey");
	values.add(domJourney);	
	String query = " select cat.referralDetails from CatsReferral cat where cat.journey = :journey ";
	
	List<?> referralDetails = factory.find(query, labels, values);
	if (referralDetails != null && referralDetails.size() > 0)
	{
		// There should be just one!
		ReferralLetterDetails domRefLetter = (ReferralLetterDetails) referralDetails.get(0);
		if (domRefLetter != null && domRefLetter.getReferrerType() != null &&
				domRefLetter.getReferrerType().getId() == SourceOfReferral.GP.getId())
		{
			// Find the Target 62Day
			HL7PathwayIf hl7Impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
			try 
			{
				TargetRefVo target = hl7Impl.getTargetByTaxonomyMap(TaxonomyType.PAS, "62D");
				hl7Impl.bringTargetIntoScopeWithoutEvent(target, journey, cancerPathwayDate);
				
			}
			catch (DomainInterfaceException e) 
			{
				super.createSystemLogEntry(SystemLogType.APPLICATION, SystemLogLevel.WARNING, e.getMessage());
				return;
			}
		}		
	}
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public void clear()
{
	if (form.getGlobalContext().Core.getPatientPhotoTempFilesIsNotNull() &&
			form.getGlobalContext().Core.getPatientPhotoTempFiles().size() > 0)			
	{
		for (String filePath : form.getGlobalContext().Core.getPatientPhotoTempFiles()) {
			
			File file = new File(filePath);
			boolean deleteFile = file.delete();				
			if (deleteFile) {
				engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.INFORMATION, "File " + filePath + " was deleted!");
			}
			else {
				engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.INFORMATION, "File " + filePath + " cannot be deleted!");
			}
		}
	}
}
 
Example 40
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public void clear()
{
	if (form.getGlobalContext().Core.getPatientPhotoTempFilesIsNotNull() &&
			form.getGlobalContext().Core.getPatientPhotoTempFiles().size() > 0)			
	{
		for (String filePath : form.getGlobalContext().Core.getPatientPhotoTempFiles()) {
			
			File file = new File(filePath);
			boolean deleteFile = file.delete();				
			if (deleteFile) {
				engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.INFORMATION, "File " + filePath + " was deleted!");
			}
			else {
				engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, SystemLogLevel.INFORMATION, "File " + filePath + " cannot be deleted!");
			}
		}
	}
}