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!");
			}
		}
	}
}
 
Example 41
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 42
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 43
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 44
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 45
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 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void catchErrors(String error, SystemLogLevel level) 
{
	if (level.equals(SystemLogLevel.ERROR)) {
		engine.showMessage(error);
	}
	
	engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, level, error);
}
 
Example 47
Project: AvoinApotti   File: PatientMergerServlet.java   Source Code and License 5 votes vote down vote up
public void proceed()
{

    // Merge Patient, we need to check for merge requests and perform the merges required
    try
    {
    	numFailedMerges=0;
    	numSuccessMerges=0;
    	
        // List tables outside loop as there should be no need to reload list all the time
        int rv=listTables();
        while (rv >= 0 && !isInterrupted)
        {
           rv = mergePatients();
           if (rv < 0)
               break;

           localLogger.debug("" + rv + " Merges Complete");
           if (!pMergeConfig.isContinousLoop())
           	break;
           
           // Sleep for a period before checking for merge requests again
       	   Thread.sleep(pMergeConfig.getSleepInterval());
       }
    }
    catch (InterruptedException e) 
    {
    	localLogger.fatal("PatientMerge Interrupted - Servlet Terminating");
    	patMergeImpl.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "PatientMerge Interrupted - Servlet Terminating");
    	mergerThread=null;
    }
    catch (Exception ex) {
    	localLogger.fatal("Exception occurred - " + ex.getMessage(), ex);
    	patMergeImpl.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "Exception occurred - " + ex.getMessage());
    }
}
 
Example 48
Project: AvoinApotti   File: DemographicsImpl.java   Source Code and License 5 votes vote down vote up
private void instantiatePatientEvent(CatsReferral doCats, PathwayRTTStatus pathRTTStatDO) throws StaleObjectException, DomainInterfaceException //WDEV-18325
{
	
	if (!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue())
		return;
	
	RTTStatusEventMapVo  rttEventMap = null;

	if (pathRTTStatDO != null)
	{
		rttEventMap = getRTTStatusEventMap(pathRTTStatDO.getRTTStatus());
	}
	if (rttEventMap == null || rttEventMap.getEvent() == null)
		return;

	PatientEventVo patEvent = new PatientEventVo();
	patEvent.setPatient((PatientRefVo) PatientListVoAssembler.create(doCats.getJourney().getPatient()));
	patEvent.setEvent(rttEventMap.getEvent());
	patEvent.setEventDateTime(new DateTime());
	patEvent.setEventStatus(EventStatus.ACTIVE);
	patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney()));
	
	try 
	{
		Class<?> implClass = Class.forName("ims.pathways.domain.impl.HL7PathwayIfImpl");
		ims.core.helper.IPathwayPatientEventHelper pathwayImp = (ims.core.helper.IPathwayPatientEventHelper) getDomainImpl(implClass);
		pathwayImp.instantiatePatientEvent(patEvent);
	} 
	catch (ClassNotFoundException e) 
	{
		// You'll have to manage this -log the exception in system log please - but it 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.");
	}

}
 
Example 49
Project: AvoinApotti   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
private DementiaConfiguration getDementiaConfigRecord(DomainFactory factory) 
{
	// Get the DementiaConfiguration record
	List cfgLst = factory.find(" from DementiaConfiguration dc where dc.isRIE is null or dc.isRIE = false");
	if (cfgLst == null || cfgLst.size() == 0)
	{
		createSystemLogEntry(SystemLogType.DEMENTIA_PROCESSING, SystemLogLevel.WARNING, "Dementia Configuration record cannot be found - processing cannot continue");
		return null;
	}
	return (DementiaConfiguration) cfgLst.get(0);
}
 
Example 50
Project: AvoinApotti   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public Integer calculateAge(Patient domPatient, Date toDate)
{
	if (domPatient != null && domPatient.getDob() != null && toDate != null)
	{		
		int patAge = new ims.framework.utils.Age(new PartialDate(domPatient.getDob()), new ims.framework.utils.Date(toDate)).getYears();
		return patAge;
	}
	// Exception null patient or no dob
	super.createSystemLogEntry(SystemLogType.DEMENTIA_PROCESSING, SystemLogLevel.WARNING, "Patient Age cannot be calculated due to null date of birth or Admission DateTime");
	return -1;
}
 
Example 51
Project: AvoinApotti   File: PatientMergeImpl.java   Source Code and License 5 votes vote down vote up
/**
 * This will be called from the servlet when an exception as been caught
 * and the transaction rolled back, this will save the request to an inactive
 * state, updating the comment with the exception String
 * @throws StaleObjectException 
 */
public void logMergeError(MergeRequestRefVo request, String exceptionStr) throws StaleObjectException 
{
	DomainFactory factory = getDomainFactory();
	MergeRequest domRequest = (MergeRequest) factory.getDomainObject(MergeRequest.class, request.getID_MergeRequest());
	domRequest.setComment(exceptionStr);
	domRequest.setStatus(true);  // Reverse logic for some reason!
	factory.save(domRequest);
	super.createSystemLogEntry(SystemLogType.PATIENT_MERGE, SystemLogLevel.ERROR, "PatientMergeError - " + exceptionStr);

}
 
Example 52
Project: AvoinApotti   File: CDSGenerateImpl.java   Source Code and License 5 votes vote down vote up
private Date fromPartialDate(Integer val)  
{
	if (val == null)
		return null;
	
	PartialDate dt = new PartialDate(val);
	if (dt.isDate())
		return dt.toDate().getDate();
	else
	{
		StringBuffer retVal= new StringBuffer();
		if (dt.getYear() != null)
			retVal.append(dt.getYear());
		if (dt.getMonth() != null)
			retVal.append(dt.getMonth());
		else
			retVal.append("1");
		if (dt.getDay() != null)
			retVal.append(dt.getDay());
		else
			retVal.append("1");
		
		try 
		{
			return new ims.framework.utils.Date(retVal.toString(),DateFormat.ISO).getDate();
		} catch (ParseException e)
		{
			super.createSystemLogEntry(SystemLogType.CDS, SystemLogLevel.ERROR, "ParseException building Date from PartialDate - " + e.getMessage());
			return null;
			
		}
	}
}
 
Example 53
Project: AvoinApotti   File: HL7EngineListener.java   Source Code and License 5 votes vote down vote up
public void stopRunning()
{
	if (isRunning)
	{
		server.stop();
		isRunning = false;
		LOG.warn("HL7 Engine has been stopped.");
		ocsIfInbound.createSystemLogEntry(SystemLogType.HL7, SystemLogLevel.WARNING, "HL7 Inbound Stopped");
	}
}
 
Example 54
Project: AvoinApotti   File: HL7EngineListener.java   Source Code and License 5 votes vote down vote up
public void startRunning()
{
	if (!isRunning)
	{
		server.start();
		startTime = new DateTime();
		isRunning = true;
		LOG.warn("HL7 Engine has been started.");			
		ocsIfInbound.createSystemLogEntry(SystemLogType.HL7, SystemLogLevel.WARNING, "HL7 Inbound Started, PORT:"  + Integer.toString(cfg.getPort()));			
	}
}
 
Example 55
Project: AvoinApotti   File: PatientKioskOperationsImpl.java   Source Code and License 5 votes vote down vote up
public void confirmPatientKioskAppointmentsForToday(Integer[] appointmentIds, String kioskId) throws ims.domain.exceptions.StaleObjectException
{	
	if(appointmentIds == null || (appointmentIds != null && appointmentIds.length == 0))
		throw new CodingRuntimeException("Cannot confirm appointments for a null array of appointments.");
	
	this.createSystemLogEntry(SystemLogType.KIOSK, SystemLogLevel.INFORMATION, "Confirm Patient Appointments (kiosk ID: " + kioskId + ")");
	
	for(int i=0; i<appointmentIds.length; i++)
	{
		if(appointmentIds[i] != null)
		{
			Booking_AppointmentShortVo newBooking = getBookingAppointment(appointmentIds[i]);
			
			if(newBooking instanceof Booking_AppointmentShortVo)
			{
				newBooking.setApptStatus(Status_Reason.ARRIVAL);
				newBooking.setArrivalTime(new Time());
				
				PatientAppointmentManagement impl = (PatientAppointmentManagement) getDomainImpl(PatientAppointmentMangementRefManImpl.class);
				
				if (!newBooking.isValidated())
				{
					newBooking.validate();
				}
				
				impl.saveBookingAppt(newBooking, false,false);	//wdev-12090					
			}
		}	
	}
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initializeEventType()
{
	form.lyrSearch().tabSeach().cmbType().clear();
	for(int x = 0; x < SystemLogType.ALL.length; x++)
	{
		form.lyrSearch().tabSeach().cmbType().newRow(SystemLogType.ALL[x], SystemLogType.ALL[x].getText(), form.getImages().Core.Organizer);
	}
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnRelaunchClick() throws PresentationLogicException
{	
	setBtnRelaunchState(false);
	clearLocalContexts();		
	checkForMandatoryContexts();		
	try
	{		
		if (checkForExistingUserLDAPCredentials())
		{				
			if (authenticateWithLDAP(form.getLocalContext().getLDAPUsername(), form.getLocalContext().getLDAPPassword()))
			{					
				launchEvolve();			
			}
			//WDEV-16339
			else
			{
				engine.open(form.getForms().Admin.LDAPLogin, new Object[]{domain.getLoggedInUser()});
			}
			//WDEV-16339					
		}
		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 58
Project: AvoinApotti   File: SystemLogProvider.java   Source Code and License 5 votes vote down vote up
public ISystemLog save(DateTime dateTime, SystemLogType type, SystemLogLevel level, String server, String user, String source, String computer, String userAgent, String sessionId, String message)
{
	SystemLogVo entry = new SystemLogVo();
	
	entry.setEventDateTime(dateTime);
	entry.setEventType(type.getId());
	entry.setEventLevel(level.getId());
	entry.setApplicationServer(server);
	entry.setUser(user);
	entry.setSource(source);
	entry.setComputer(computer);
	entry.setMessage(message);
	entry.setSessionId(sessionId);
	entry.setUserAgent(userAgent);
	
	ims.core.admin.domain.objects.SystemLog domainObject = SystemLogVoAssembler.extractSystemLog(getDomainFactory(), entry);
	try 
	{
		getDomainFactory().save(domainObject);
	} 
	catch (StaleObjectException e) 
	{
		return null;
	}
	
	return SystemLogVoAssembler.create(domainObject);
}
 
Example 59
Project: AvoinApotti   File: PatientKioskConfigImpl.java   Source Code and License 5 votes vote down vote up
/**
* Returns the patient kiosk settings
*/	
public ims.core.vo.PatientKioskSettingsVo getPatientKioskSettings(String kioskId)
{
	if (kioskId != null)
		this.createSystemLogEntry(SystemLogType.KIOSK, SystemLogLevel.INFORMATION, "Get Kiosk Settings (kiosk ID: " + kioskId + ")");
	
	DomainFactory factory = getDomainFactory();		
	PatientKioskSettingsVoCollection psVoColl = new PatientKioskSettingsVoCollection();
	psVoColl = PatientKioskSettingsVoAssembler.createPatientKioskSettingsVoCollectionFromPatientKioskSettings(factory.find("from PatientKioskSettings")); 
	
	if (psVoColl != null && psVoColl.size() != 0)
		return PatientKioskSettingsVoAssembler.createPatientKioskSettingsVoCollectionFromPatientKioskSettings(factory.find("from PatientKioskSettings")).get(0);
	else
	{
		// return default values
		PatientKioskSettingsVo defaultPSVo = new PatientKioskSettingsVo();
		defaultPSVo.setWebServiceUrl("");
		defaultPSVo.setAppUpdateUrl("");
		defaultPSVo.setTimeout(2);
		defaultPSVo.setTheme(PatientKioskTheme.BLUE);
		defaultPSVo.setAutoInstallUpdates(true);
		defaultPSVo.setAllowedDelay(0);
		defaultPSVo.setShowAppointments(false);
		
		// messages
		defaultPSVo.setMessages(getDefaultKioskMessages());
		return defaultPSVo;
	}
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void catchErrors(String error, SystemLogLevel level) 
{
	if (level.equals(SystemLogLevel.ERROR)) {
		engine.showMessage(error);
	}
	
	LOG.error(error);
	engine.createSystemLogEntry(SystemLogType.FILE_UPLOADING, level, error);
}