Java Code Examples for ims.admin.vo.AppImageVo

The following are top voted examples for showing how to use ims.admin.vo.AppImageVo. 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
protected void onFormOpen(Object[] args) throws PresentationLogicException 
{
	if (args != null)
	{
		if (args[0] != null && args[0] instanceof AppImageVo)
		{
			form.lyrPatientImage().tabUpload().imgImageUpload().setValue((AppImageVo)args[0]);
		}
		else
		{
			form.lyrPatientImage().tabUpload().imgImageUpload().setValue(form.getImages().Core.NoPatientImage);
		}
	}
	
	initialise();
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingForClinicianWorklistAndTriageVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingListForClinicianWorklistVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo = tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(engine.getRegisteredImage(102554).getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingListForTriageVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingForDisplayClinicianAndTriageWorklistVo tracking) throws IOException //WDEV-18001
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13186
 * Update the context menu options state
 * 
 */
private void updateContextMenuState()
{
	// Set a reference to selected image
	AppImageVo selectedImage = form.grdImages().getValue();
	
	// - 'Activate/Inactivate' option - visible only in VIEW mode for non system images
	form.getContextMenus().getImageAdminActivateItem().setVisible(selectedImage != null && !Boolean.TRUE.equals(selectedImage.getIsSystem()));

	// Set image and text for 'Activate/Inactivate' option
	// - if the action is active then set the text to 'Deactivate' and appropriate image
	// - else (and by default when no image is selected) set the text to 'Activate' and appropriate image
	if (selectedImage != null && Boolean.TRUE.equals(selectedImage.getIsActive()))
	{
		form.getContextMenus().getImageAdminActivateItem().setIcon(form.getImages().Core.Delete);
		form.getContextMenus().getImageAdminActivateItem().setText("Deactivate");
	}
	else
	{
		form.getContextMenus().getImageAdminActivateItem().setIcon(form.getImages().Core.Tick);
		form.getContextMenus().getImageAdminActivateItem().setText("Activate");
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnSelectClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.grdImages().getSelectedRow() == null)
	{
		engine.showErrors(new String[]{"Please select an image."});
		return;
	}
	Integer id = form.grdImages().getSelectedRow().getValue().getImageId();
	AppImageVo image =  domain.getImageById(id);
	if (image == null)
	{
		engine.showErrors(new String[]{"Database problems. The selected image couldn't be found in the database."});
		return;
	}
	INavigationNode nav = form.getGlobalContext().Admin.getNavigationEditedGroup();
	nav.setTextNode(form.txtName().getValue());
	nav.setImageNode(image);
	form.getGlobalContext().Admin.setNavigationEditedGroup(nav);
	engine.close(DialogResult.OK);
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen(Object[] args) throws PresentationLogicException 
{
	if (args != null)
	{
		if (args[0] != null && args[0] instanceof AppImageVo)
		{
			form.lyrPatientImage().tabUpload().imgImageUpload().setValue((AppImageVo)args[0]);
		}
		else
		{
			form.lyrPatientImage().tabUpload().imgImageUpload().setValue(form.getImages().Core.NoPatientImage);
		}
	}
	
	initialise();
}
 
Example 13
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingForClinicianWorklistAndTriageVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingListForClinicianWorklistVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo = tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(engine.getRegisteredImage(102554).getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingListForTriageVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 19
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingListForTriageVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingForPatientWhiteBoardVo tempVo) throws IOException
{
	if (tempVo == null || tempVo.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tempVo.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingForDisplayClinicianAndTriageWorklistVo tracking) throws IOException //WDEV-18001
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 23
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnSelectClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.grdImages().getSelectedRow() == null)
	{
		engine.showErrors(new String[]{"Please select an image."});
		return;
	}
	Integer id = form.grdImages().getSelectedRow().getValue().getImageId();
	AppImageVo image =  domain.getImageById(id);
	if (image == null)
	{
		engine.showErrors(new String[]{"Database problems. The selected image couldn't be found in the database."});
		return;
	}
	INavigationNode nav = form.getGlobalContext().Admin.getNavigationEditedGroup();
	nav.setTextNode(form.txtName().getValue());
	nav.setImageNode(image);
	form.getGlobalContext().Admin.setNavigationEditedGroup(nav);
	engine.close(DialogResult.OK);
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13186
 * Update the context menu options state
 * 
 */
private void updateContextMenuState()
{
	// Set a reference to selected image
	AppImageVo selectedImage = form.grdImages().getValue();
	
	// - 'Activate/Inactivate' option - visible only in VIEW mode for non system images
	form.getContextMenus().getImageAdminActivateItem().setVisible(selectedImage != null && !Boolean.TRUE.equals(selectedImage.getIsSystem()));

	// Set image and text for 'Activate/Inactivate' option
	// - if the action is active then set the text to 'Deactivate' and appropriate image
	// - else (and by default when no image is selected) set the text to 'Activate' and appropriate image
	if (selectedImage != null && Boolean.TRUE.equals(selectedImage.getIsActive()))
	{
		form.getContextMenus().getImageAdminActivateItem().setIcon(form.getImages().Core.Delete);
		form.getContextMenus().getImageAdminActivateItem().setText("Deactivate");
	}
	else
	{
		form.getContextMenus().getImageAdminActivateItem().setIcon(form.getImages().Core.Tick);
		form.getContextMenus().getImageAdminActivateItem().setText("Activate");
	}
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen(Object[] args) throws PresentationLogicException 
{
	if (args != null)
	{
		if (args[0] != null && args[0] instanceof AppImageVo)
		{
			form.lyrPatientImage().tabUpload().imgImageUpload().setValue((AppImageVo)args[0]);
		}
		else
		{
			form.lyrPatientImage().tabUpload().imgImageUpload().setValue(form.getImages().Core.NoPatientImage);
		}
	}
	
	initialise();
}
 
Example 26
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingListForClinicianWorklistVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo = tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(engine.getRegisteredImage(102554).getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingListForTriageVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingForDisplayClinicianAndTriageWorklistVo tracking) throws IOException //WDEV-18001
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 33
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13186
 * Update the context menu options state
 * 
 */
private void updateContextMenuState()
{
	// Set a reference to selected image
	AppImageVo selectedImage = form.grdImages().getValue();
	
	// - 'Activate/Inactivate' option - visible only in VIEW mode for non system images
	form.getContextMenus().getImageAdminActivateItem().setVisible(selectedImage != null && !Boolean.TRUE.equals(selectedImage.getIsSystem()));

	// Set image and text for 'Activate/Inactivate' option
	// - if the action is active then set the text to 'Deactivate' and appropriate image
	// - else (and by default when no image is selected) set the text to 'Activate' and appropriate image
	if (selectedImage != null && Boolean.TRUE.equals(selectedImage.getIsActive()))
	{
		form.getContextMenus().getImageAdminActivateItem().setIcon(form.getImages().Core.Delete);
		form.getContextMenus().getImageAdminActivateItem().setText("Deactivate");
	}
	else
	{
		form.getContextMenus().getImageAdminActivateItem().setIcon(form.getImages().Core.Tick);
		form.getContextMenus().getImageAdminActivateItem().setText("Activate");
	}
}
 
Example 34
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnSelectClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.grdImages().getSelectedRow() == null)
	{
		engine.showErrors(new String[]{"Please select an image."});
		return;
	}
	Integer id = form.grdImages().getSelectedRow().getValue().getImageId();
	AppImageVo image =  domain.getImageById(id);
	if (image == null)
	{
		engine.showErrors(new String[]{"Database problems. The selected image couldn't be found in the database."});
		return;
	}
	INavigationNode nav = form.getGlobalContext().Admin.getNavigationEditedGroup();
	nav.setTextNode(form.txtName().getValue());
	nav.setImageNode(image);
	form.getGlobalContext().Admin.setNavigationEditedGroup(nav);
	engine.close(DialogResult.OK);
}
 
Example 35
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13186
 * Update the context menu options state
 * 
 */
private void updateContextMenuState()
{
	// Set a reference to selected image
	AppImageVo selectedImage = form.grdImages().getValue();
	
	// - 'Activate/Inactivate' option - visible only in VIEW mode for non system images
	form.getContextMenus().getImageAdminActivateItem().setVisible(selectedImage != null && !Boolean.TRUE.equals(selectedImage.getIsSystem()));

	// Set image and text for 'Activate/Inactivate' option
	// - if the action is active then set the text to 'Deactivate' and appropriate image
	// - else (and by default when no image is selected) set the text to 'Activate' and appropriate image
	if (selectedImage != null && Boolean.TRUE.equals(selectedImage.getIsActive()))
	{
		form.getContextMenus().getImageAdminActivateItem().setIcon(form.getImages().Core.Delete);
		form.getContextMenus().getImageAdminActivateItem().setText("Deactivate");
	}
	else
	{
		form.getContextMenus().getImageAdminActivateItem().setIcon(form.getImages().Core.Tick);
		form.getContextMenus().getImageAdminActivateItem().setText("Activate");
	}
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen(Object[] args) throws PresentationLogicException 
{
	if (args != null)
	{
		if (args[0] != null && args[0] instanceof AppImageVo)
		{
			form.lyrPatientImage().tabUpload().imgImageUpload().setValue((AppImageVo)args[0]);
		}
		else
		{
			form.lyrPatientImage().tabUpload().imgImageUpload().setValue(form.getImages().Core.NoPatientImage);
		}
	}
	
	initialise();
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingForClinicianWorklistAndTriageVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo =  tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPatientToLocalCollection(AppImageVo patientImage) 
{
	if(patientImage == null)
		return;
	
	List<String> imagesColl = form.getLocalContext().getPatientImagesList();
	
	if (imagesColl == null)
		imagesColl = new ArrayList<String>();
	
	if (EnvironmentConfig.getFileUploadMountpoint() != null && EnvironmentConfig.getFileUploadMountpoint() != "")
	{
		imagesColl.add(EnvironmentConfig.getFileUploadMountpoint() + patientImage.getImagePath());
	}
	else
	{
		imagesColl.add(EnvironmentConfig.getBaseUri() + patientImage.getImagePath());
	}
	
	form.getLocalContext().setPatientImagesList(imagesColl);
}
 
Example 40
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppImageVo getPatientImage(TrackingListForClinicianWorklistVo tracking) throws IOException
{
	if (tracking == null || tracking.getPatient() == null)
		return null;
	
	String sessionID = engine.getSessionId();
	
	AppDBImageVo dbImageVo = tracking.getPatient().getPhoto();
	
	//Existing Patient with no image
	if (dbImageVo == null)
	{
		// NoPatientImage	
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(engine.getRegisteredImage(102554).getImagePath());
		
		return imageVo;
	}
	
	String encodedImage = dbImageVo.getImageData();
	String type = dbImageVo.getImageType().getText();	  		  		  	
 	
	return decodeFromBase64(encodedImage, sessionID, type);
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialise()
{
	form.getLocalContext().setCurrentImage(new AppImageVo());							
	form.lyrPatientImage().tabUpload().setHeaderEnabled(true);
	form.lyrPatientImage().tabScan().setHeaderEnabled(true);
	form.btnSave().setEnabled(false);
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onQmbImageTextSubmited(String value) throws PresentationLogicException
{
	AppImageVo filter = new AppImageVo();
	filter.setImagePath(form.lyrFindings().tabView().qmbImage().getEditedText());

	AppImageVoCollection voColl = domain.listImages(filter);
	form.lyrFindings().tabView().qmbImage().clear();

	if (voColl != null)
	{
		for (int i = 0; i < voColl.size(); i++)
		{
			form.lyrFindings().tabView().qmbImage().newRow(voColl.get(i), voColl.get(i).getImagePath());
		}

		if (voColl.size() > 1)
		{
			form.lyrFindings().tabView().qmbImage().showOpened();
		}
		else if (voColl.size() == 1)
		{
			form.lyrFindings().tabView().qmbImage().setValue(voColl.get(0));
			setSelContextImage(voColl.get(0));
			onQmbImageValueChanged();
		}
	}
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void imageValueChanged()
{
	AppImageVo appImageVo = form.lyrFindings().tabView().qmbImage().getValue();
	if (appImageVo != null)
	{
		setImagePickerValue(engine.getRegisteredImage(appImageVo.getID_AppImage().intValue()));
	}
	else
	{
		setDefaultImagePickerValue();
	}
	setSelContextImage(appImageVo);
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setImage(AppImageVo image)
{
	if (image != null)
	{
		if (form.lyrFindings().tabView().qmbImage().getValues().indexOf(image) < 0)
			form.lyrFindings().tabView().qmbImage().newRow(image, image.getImagePath());
		form.lyrFindings().tabView().qmbImage().setValue(image);
		setImagePickerValue(engine.getRegisteredImage(image.getID_AppImage().intValue()));
	}
	setSelContextImage(image);
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String[] validateUIRules()
{
	ArrayList errors = new ArrayList();
	Color color = form.lyrFindings().tabView().cmbColor().getValue();
	AppImageVo voAppImage = form.lyrFindings().tabView().qmbImage().getValue();
	GroupColourImageEnumeration groupColourImg = form.lyrFindings().tabView().GroupColourImage().getValue();

	if (groupColourImg.equals(GroupColourImageEnumeration.rdoColouredLine) && color == null)
	{
		errors.add("Please select a Colour");
	}

	if (groupColourImg.equals(GroupColourImageEnumeration.rdoImage))
	{
		if (voAppImage == null)
			errors.add("Please select an Image");
		if (form.lyrFindings().tabView().GroupRenderStyle().getValue().equals(GroupRenderStyleEnumeration.None))
			errors.add("Please select Image Render Style");
	}

	if (errors.size() == 0)
		return null;

	String[] findingErrors = new String[errors.size()];
	errors.toArray(findingErrors);

	return findingErrors;
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppImageVo decodeFromBase64(String content, String sessionID, String imageType) throws IOException
{
	byte[] decBytes = Base64.decode(content);

	if (decBytes == null || (decBytes != null && decBytes.length == 0)) 
	{
		engine.showMessage("Base64 image size is zero");
		return null;
	}
	 
    String str = generateName();
    String image = EnvironmentConfig.getBaseUri() + ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + str + "." + imageType.toLowerCase();		
	
	try
	{		
		FileOutputStream fos = new FileOutputStream(image);				
		fos.write(decBytes);
		fos.close();	
		
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(((ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + str + "." + imageType.toLowerCase()).replace("\\", "/")));
		return imageVo;
	}		
	catch(FileNotFoundException exception) {			
		System.out.println("FileNotFoundException : " + exception);
	}		
	catch(IOException ioexception) {						
		System.out.println("IOException : " + ioexception);
	}
					
	return null;	
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppImageVo decodeFromBase64(String content, String sessionID, String imageType) throws IOException
{
	byte[] decBytes = Base64.decode(content);

	if (decBytes == null || (decBytes != null && decBytes.length == 0)) 
	{
		engine.showMessage("Base64 image size is zero");
		return null;
	}
	//Get CurrentTimeMillis() segment
	String str = generateName();
	String image = EnvironmentConfig.getBaseUri() + ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + str + "." + imageType.toLowerCase();		
	
	try
	{		
		FileOutputStream fos = new FileOutputStream(image);				
		fos.write(decBytes);
		fos.close();	
		
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath((EnvironmentConfig.getAplicationURL() + (ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + str + "." + imageType.toLowerCase()).replace("\\", "/")));
		return imageVo;
	}		
	catch(FileNotFoundException exception) {			
		System.out.println("FileNotFoundException : " + exception);
	}		
	catch(IOException ioexception) {						
		System.out.println("IOException : " + ioexception);
	}
					
	return null;			
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppImageVo decodeFromBase64(String content, String sessionID, String imageType) throws IOException
{
	byte[] decBytes = Base64.decode(content);

	if (decBytes == null || (decBytes != null && decBytes.length == 0)) 
	{
		engine.showMessage("Base64 image size is zero");
		return null;
	}
	 
    String str = generateName();
    String image = EnvironmentConfig.getBaseUri() + ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + str + "." + imageType.toLowerCase();		
	
	try
	{		
		FileOutputStream fos = new FileOutputStream(image);				
		fos.write(decBytes);
		fos.close();	
		
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(((ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + str + "." + imageType.toLowerCase()).replace("\\", "/")));
		return imageVo;
	}		
	catch(FileNotFoundException exception) {			
		System.out.println("FileNotFoundException : " + exception);
	}		
	catch(IOException ioexception) {						
		System.out.println("IOException : " + ioexception);
	}
					
	return null;			
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppImageVo decodeFromBase64(String content, String sessionID, String imageType) throws IOException
{
	byte[] decBytes = Base64.decode(content);

	if (decBytes == null || (decBytes != null && decBytes.length == 0)) 
	{
		engine.showMessage("Base64 image size is zero");
		return null;
	}
	 
    String str = generateName();
    String image = EnvironmentConfig.getBaseUri() + ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + str + "." + imageType.toLowerCase();		
	
	try
	{		
		FileOutputStream fos = new FileOutputStream(image);				
		fos.write(decBytes);
		fos.close();	
		
		AppImageVo imageVo = new AppImageVo();
		imageVo.setImagePath(((ConfigFlag.GEN.FILE_UPLOAD_DIR.getValue() + str + "." + imageType.toLowerCase()).replace("\\", "/")));
		return imageVo;
	}		
	catch(FileNotFoundException exception) {			
		System.out.println("FileNotFoundException : " + exception);
	}		
	catch(IOException ioexception) {						
		System.out.println("IOException : " + ioexception);
	}
					
	return null;	
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppImageVo getPatientImage()
{
	AppImageVo imageVo = new AppImageVo();
	imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
	return imageVo;
	
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppImageVo getPatientImage()
{
	AppImageVo imageVo = new AppImageVo();
	imageVo.setImagePath(form.getImages().Core.NoPatientImage.getImagePath());
		
	return imageVo;
	
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException
{
	form.setMode(FormMode.EDIT);
	clearDetails(); 
	form.getLocalContext().setCurrentImage(new AppImageVo());
	// wdev-11245
	form.getLocalContext().setEditdRecord(null);
	// -----------

}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onGrdImagesSelectionChanged()
{
	AppImageVo image = form.grdImages().getValue();
	if (image != null)
	{
		fillDetails(image);

	}
	updateControlsState();
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Admin.ImageSelectDialog))
	{
		AppImageVo voAppImage = form.getGlobalContext().Admin.getSelectedImage();
		if (voAppImage != null)
		{
			Image image = engine.getRegisteredImage(voAppImage.getID_AppImage().intValue());
			form.lyrDrawing().tabImageSelect().txtImagePath().setValue(voAppImage.getImagePath());
			form.lyrDrawing().tabImageSelect().imgPreview().setValue(image);

			DrawingGraphicImageVo voGraphicImage = form.getLocalContext().getImageRecord();
			if (voGraphicImage != null)
			{
				// Set the selected image
				voGraphicImage.setImage(voAppImage);

				// Set the Default Root Group
				if (voGraphicImage != null && voGraphicImage.getRootGroup() == null)
				{
					GraphicGroupVo voGraphicGroup = new GraphicGroupVo();
					voGraphicGroup.setGroupName(voGraphicImage.getImageName());
					voGraphicImage.setRootGroup(voGraphicGroup);
				}
				setDefaultImage(voGraphicImage);

				form.getLocalContext().setImageRecord(voGraphicImage);
				enbleRegionConfigTab(true);
			}
		}
	}
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnOkClick() throws ims.framework.exceptions.PresentationLogicException
{
	AppImageVo voImage = form.getGlobalContext().Admin.getSelectedImage();
	if(voImage != null)
	{
		form.getGlobalContext().Admin.setSelectedImage(voImage);
		engine.close(DialogResult.OK);
	}
	else
	{
		engine.showMessage("Please select an image");
	}
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateImageGrid(String imageName) 
{
	if(imageName == null)
		imageName = form.txtFilter().getValue();

	clearDetails();
	form.grdImages().getRows().clear();
	
	AppImageVo vo = new AppImageVo();
	vo.setImagePath(imageName);
	if (form.chkSystemOnly().getValue())
	{
		vo.setIsSystem(Boolean.FALSE);			
	}
	AppImageVoCollection images = domain.listImages(vo);
	
	if (images != null)
	{
		GenForm.grdImagesRow row = null;
		
		for (int i = 0; i < images.size(); i++)
		{
			AppImageVo image = images.get(i);
			row = form.grdImages().getRows().newRow();
			row.setInternalID(image.getID_AppImage());
			row.setImagePath(image.getImagePath());
			row.setSystem(image.getIsSystem().booleanValue());
			row.setTooltipForImagePath(image.getImagePath());
			row.setValue(image);
		}
	}
	form.lblTotal().setValue("Total : " + form.grdImages().getRows().size());
}
 
Example 57
Project: AvoinApotti   File: ImageAdminImpl.java   Source Code and License 5 votes vote down vote up
public AppImageVoCollection listImages(String filter) 
{
	AppImageVo vo = new AppImageVo();
	vo.setImagePath(filter);
	vo.setIsActive(Boolean.TRUE);
	return listImages(vo);	
}
 
Example 58
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialise()
{
	form.getLocalContext().setCurrentImage(new AppImageVo());							
	form.lyrPatientImage().tabUpload().setHeaderEnabled(true);
	form.lyrPatientImage().tabScan().setHeaderEnabled(true);
	form.btnSave().setEnabled(false);
}
 
Example 59
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onQmbImageTextSubmited(String value) throws PresentationLogicException
{
	AppImageVo filter = new AppImageVo();
	filter.setImagePath(form.lyrFindings().tabView().qmbImage().getEditedText());

	AppImageVoCollection voColl = domain.listImages(filter);
	form.lyrFindings().tabView().qmbImage().clear();

	if (voColl != null)
	{
		for (int i = 0; i < voColl.size(); i++)
		{
			form.lyrFindings().tabView().qmbImage().newRow(voColl.get(i), voColl.get(i).getImagePath());
		}

		if (voColl.size() > 1)
		{
			form.lyrFindings().tabView().qmbImage().showOpened();
		}
		else if (voColl.size() == 1)
		{
			form.lyrFindings().tabView().qmbImage().setValue(voColl.get(0));
			setSelContextImage(voColl.get(0));
			onQmbImageValueChanged();
		}
	}
}
 
Example 60
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void imageValueChanged()
{
	AppImageVo appImageVo = form.lyrFindings().tabView().qmbImage().getValue();
	if (appImageVo != null)
	{
		setImagePickerValue(engine.getRegisteredImage(appImageVo.getID_AppImage().intValue()));
	}
	else
	{
		setDefaultImagePickerValue();
	}
	setSelContextImage(appImageVo);
}