Java Code Examples for ims.framework.enumerations.PrinterScope

The following are top voted examples for showing how to use ims.framework.enumerations.PrinterScope. 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() throws ims.framework.exceptions.FormOpenException
{
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{
		GenForm.grdPrintersRow row;
		for(int i=0;i<printers.length;i++)
		{
			row = form.grdPrinters().getRows().newRow();
			row.setPrinter(printers[i].getIPrinterName());
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.DEFAULT);
		if (defaultPrinter != null)
		{
			form.grdPrinters().setValue(defaultPrinter.getIPrinterName());
		}
	}		
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnAddClick() throws ims.framework.exceptions.PresentationLogicException
{
	grdSearchRow row1;
	for (int i = 0; i < form.grdSearch().getRows().size(); i++)
	{
		row1 = form.grdSearch().getRows().get(i);
		if (row1.getColumnSelect())
		{
			grdListRow row2 = form.grdList().getRows().newRow();
			row2.setcolItems(row1.getcolItems());
			row2.setValue(row1.getValue());					
		}			
	}
	
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);		
	
	form.btnAdd().setEnabled(false);
	updateControlsState();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize()
{
	// Set current location
	ILocation currentLocation = domain.getCurrentLocation();
	
	//wdev-17031
	String name = null;
	if( currentLocation != null)
	{
		name = currentLocation.getName();
		if( name != null  &&  name.length() >  90)
			name = name.substring(0, 79);
			
	}
	form.lblLocation().setValue(currentLocation != null ? name : "No location selected");
	
	// Initialize component
	form.ccSelectPrinter().initialize(currentLocation, PrinterScope.DEFAULT);
	form.ccSelectPrinter().setIsRequired(Boolean.TRUE); //WDEV-17625
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateLocalPrinters(DynamicGridCell cell) 
{
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{			
		for(int i=0;i<printers.length;i++)
		{				 
			cell.getItems().newItem(printers[i].getIPrinterName(), printers[i].getIPrinterName());				
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
		if (defaultPrinter != null)
		{					
			cell.setValue(defaultPrinter.getIPrinterName());
		}
	}	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException
{
	/*String[] printers = domain.getCurrentLocationPrinters();
	addPrinters(printers);
	printers = domain.getCurrentLocationPrinters(true);
	addPrinters(printers);*/
	
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{			
		for(int i=0;i<printers.length;i++)
		{
			form.cmbPrinter().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
		if (defaultPrinter != null)
		{				
			form.cmbPrinter().setValue(defaultPrinter.getIPrinterName());
		}
	}	
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPrinters(IPrinter[] printers)
{
	if(printers != null && printers.length > 0)
	{
		for (int i = 0; i < printers.length; i++)
		{
			form.qmbPrinter().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
			form.qmbPrinterLabels().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
		}
	}
	IPrinter defaultPrinter = domain.getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.DEFAULT);
	if (defaultPrinter != null)
		form.qmbPrinter().setValue(defaultPrinter.getIPrinterName());

	IPrinter labelPrinter = domain.getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	if (labelPrinter != null)
		form.qmbPrinterLabels().setValue(labelPrinter.getIPrinterName());
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException
{
	initializeDynamicGrid();
	//WDEV-16115
	form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.NEWRESULT);
	if (form.ccPrinter().getSelectedPrinter() == null)
	{
		form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	}
	PathologyResultListShortVoCollection results = form.getGlobalContext().OCRR.getResultsForPrint();
	if (results == null)
		return;

	Integer nNewResUnseenDays = new Integer(ConfigFlag.DOM.OCS_NEWRES_UNSEEN_CUTOFF.getValue());
	Date dateUnseen = new Date().addDay(-1 * nNewResUnseenDays.intValue());

	for (int x = 0; x < results.size(); x++)
	{
		addResult(results.get(x), dateUnseen);
	}		
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{
		GenForm.grdPrintersRow row;
		for(int i=0;i<printers.length;i++)
		{
			row = form.grdPrinters().getRows().newRow();
			row.setPrinter(printers[i].getIPrinterName());
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.DEFAULT);
		if (defaultPrinter != null)
		{
			form.grdPrinters().setValue(defaultPrinter.getIPrinterName());
		}
	}		
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.FormOpenException
{
	if(args != null && args.length > 0)
	{
		if(args[0] instanceof FormName)
		{
			form.getLocalContext().setDialogName((FormName) args[0]);
		}
	}
	
	form.ccPrinters().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT, false);	
	form.intNoOfCopies().setValue(1);
	
	if(form.getGlobalContext().Core.getPrepareForPrintingIsNotNull() && form.getGlobalContext().Core.getPrepareForPrinting().equals(Boolean.TRUE))
	{
		form.btnPreview().setEnabled(false);
	}
	
	form.chkStoreCopy().setVisible(ConfigFlag.GEN.CREATE_NEW_PATIENTDOCUMENT_ON_PRINTREPORTDIALOG.getValue() && form.getGlobalContext().Core.getPatientShortIsNotNull());//WDEV-17772
	
	open();
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen(Object[] args) throws PresentationLogicException 
{
	
	form.ccPrinters().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT, false);	
	
	// WDEV-16406
	form.ccPrinters().setIsRequired(Boolean.TRUE);
					
	if(form.getGlobalContext().Core.getPrepareForPrintingIsNotNull() && form.getGlobalContext().Core.getPrepareForPrinting().equals(Boolean.TRUE))
	{
		form.btnPreview().setEnabled(false);
	}
	
	if (args != null && args.length>=3)
	{
		if (args[0] instanceof String)
			form.getLocalContext().setOrderBy((String)args[0]);
		if (args[1] instanceof Date)
			form.getLocalContext().setstartDate((Date)args[1]);
		if (args[2] instanceof String)
			form.getLocalContext().setClinic((String)args[2]);
	}
	open();
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnAddClick() throws ims.framework.exceptions.PresentationLogicException
{
	grdSearchRow row1;
	for (int i = 0; i < form.grdSearch().getRows().size(); i++)
	{
		row1 = form.grdSearch().getRows().get(i);
		if (row1.getColumnSelect())
		{
			grdListRow row2 = form.grdList().getRows().newRow();
			row2.setcolItems(row1.getcolItems());
			row2.setValue(row1.getValue());					
		}			
	}
	
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);		
	
	form.btnAdd().setEnabled(false);
	updateControlsState();
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize()
{
	// Set current location
	ILocation currentLocation = domain.getCurrentLocation();
	
	//wdev-17031
	String name = null;
	if( currentLocation != null)
	{
		name = currentLocation.getName();
		if( name != null  &&  name.length() >  90)
			name = name.substring(0, 79);
			
	}
	form.lblLocation().setValue(currentLocation != null ? name : "No location selected");
	
	// Initialize component
	form.ccSelectPrinter().initialize(currentLocation, PrinterScope.DEFAULT);
	form.ccSelectPrinter().setIsRequired(Boolean.TRUE); //WDEV-17625
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateLocalPrinters(DynamicGridCell cell) 
{
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{			
		for(int i=0;i<printers.length;i++)
		{				 
			cell.getItems().newItem(printers[i].getIPrinterName(), printers[i].getIPrinterName());				
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
		if (defaultPrinter != null)
		{					
			cell.setValue(defaultPrinter.getIPrinterName());
		}
	}	
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException
{
	/*String[] printers = domain.getCurrentLocationPrinters();
	addPrinters(printers);
	printers = domain.getCurrentLocationPrinters(true);
	addPrinters(printers);*/
	
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{			
		for(int i=0;i<printers.length;i++)
		{
			form.cmbPrinter().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
		if (defaultPrinter != null)
		{				
			form.cmbPrinter().setValue(defaultPrinter.getIPrinterName());
		}
	}	
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPrinters(IPrinter[] printers)
{
	if(printers != null && printers.length > 0)
	{
		for (int i = 0; i < printers.length; i++)
		{
			form.qmbPrinter().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
			form.qmbPrinterLabels().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
		}
	}
	IPrinter defaultPrinter = domain.getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.DEFAULT);
	if (defaultPrinter != null)
		form.qmbPrinter().setValue(defaultPrinter.getIPrinterName());

	IPrinter labelPrinter = domain.getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	if (labelPrinter != null)
		form.qmbPrinterLabels().setValue(labelPrinter.getIPrinterName());
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException
{
	initializeDynamicGrid();
	//WDEV-16115
	form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.NEWRESULT);
	if (form.ccPrinter().getSelectedPrinter() == null)
	{
		form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	}
	PathologyResultListShortVoCollection results = form.getGlobalContext().OCRR.getResultsForPrint();
	if (results == null)
		return;

	Integer nNewResUnseenDays = new Integer(ConfigFlag.DOM.OCS_NEWRES_UNSEEN_CUTOFF.getValue());
	Date dateUnseen = new Date().addDay(-1 * nNewResUnseenDays.intValue());

	for (int x = 0; x < results.size(); x++)
	{
		addResult(results.get(x), dateUnseen);
	}		
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{
		GenForm.grdPrintersRow row;
		for(int i=0;i<printers.length;i++)
		{
			row = form.grdPrinters().getRows().newRow();
			row.setPrinter(printers[i].getIPrinterName());
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.DEFAULT);
		if (defaultPrinter != null)
		{
			form.grdPrinters().setValue(defaultPrinter.getIPrinterName());
		}
	}		
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnAddClick() throws ims.framework.exceptions.PresentationLogicException
{
	grdSearchRow row1;
	for (int i = 0; i < form.grdSearch().getRows().size(); i++)
	{
		row1 = form.grdSearch().getRows().get(i);
		if (row1.getColumnSelect())
		{
			grdListRow row2 = form.grdList().getRows().newRow();
			row2.setcolItems(row1.getcolItems());
			row2.setValue(row1.getValue());					
		}			
	}
	
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);		
	
	form.btnAdd().setEnabled(false);
	updateControlsState();
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize()
{
	// Set current location
	ILocation currentLocation = domain.getCurrentLocation();
	
	//wdev-17031
	String name = null;
	if( currentLocation != null)
	{
		name = currentLocation.getName();
		if( name != null  &&  name.length() >  90)
			name = name.substring(0, 79);
			
	}
	form.lblLocation().setValue(currentLocation != null ? name : "No location selected");
	
	// Initialize component
	form.ccSelectPrinter().initialize(currentLocation, PrinterScope.DEFAULT);
	form.ccSelectPrinter().setIsRequired(Boolean.TRUE); //WDEV-17625
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateLocalPrinters(DynamicGridCell cell) 
{
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{			
		for(int i=0;i<printers.length;i++)
		{				 
			cell.getItems().newItem(printers[i].getIPrinterName(), printers[i].getIPrinterName());				
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
		if (defaultPrinter != null)
		{					
			cell.setValue(defaultPrinter.getIPrinterName());
		}
	}	
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException
{
	/*String[] printers = domain.getCurrentLocationPrinters();
	addPrinters(printers);
	printers = domain.getCurrentLocationPrinters(true);
	addPrinters(printers);*/
	
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{			
		for(int i=0;i<printers.length;i++)
		{
			form.cmbPrinter().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
		if (defaultPrinter != null)
		{				
			form.cmbPrinter().setValue(defaultPrinter.getIPrinterName());
		}
	}	
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPrinters(IPrinter[] printers)
{
	if(printers != null && printers.length > 0)
	{
		for (int i = 0; i < printers.length; i++)
		{
			form.qmbPrinter().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
			form.qmbPrinterLabels().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
		}
	}
	IPrinter defaultPrinter = domain.getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.DEFAULT);
	if (defaultPrinter != null)
		form.qmbPrinter().setValue(defaultPrinter.getIPrinterName());

	IPrinter labelPrinter = domain.getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	if (labelPrinter != null)
		form.qmbPrinterLabels().setValue(labelPrinter.getIPrinterName());
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException
{
	initializeDynamicGrid();
	//WDEV-16115
	form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.NEWRESULT);
	if (form.ccPrinter().getSelectedPrinter() == null)
	{
		form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	}
	PathologyResultListShortVoCollection results = form.getGlobalContext().OCRR.getResultsForPrint();
	if (results == null)
		return;

	Integer nNewResUnseenDays = new Integer(ConfigFlag.DOM.OCS_NEWRES_UNSEEN_CUTOFF.getValue());
	Date dateUnseen = new Date().addDay(-1 * nNewResUnseenDays.intValue());

	for (int x = 0; x < results.size(); x++)
	{
		addResult(results.get(x), dateUnseen);
	}		
}
 
Example 24
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{
		GenForm.grdPrintersRow row;
		for(int i=0;i<printers.length;i++)
		{
			row = form.grdPrinters().getRows().newRow();
			row.setPrinter(printers[i].getIPrinterName());
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.DEFAULT);
		if (defaultPrinter != null)
		{
			form.grdPrinters().setValue(defaultPrinter.getIPrinterName());
		}
	}		
}
 
Example 25
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnAddClick() throws ims.framework.exceptions.PresentationLogicException
{
	grdSearchRow row1;
	for (int i = 0; i < form.grdSearch().getRows().size(); i++)
	{
		row1 = form.grdSearch().getRows().get(i);
		if (row1.getColumnSelect())
		{
			grdListRow row2 = form.grdList().getRows().newRow();
			row2.setcolItems(row1.getcolItems());
			row2.setValue(row1.getValue());					
		}			
	}
	
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);		
	
	form.btnAdd().setEnabled(false);
	updateControlsState();
}
 
Example 26
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize()
{
	// Set current location
	ILocation currentLocation = domain.getCurrentLocation();
	
	//wdev-17031
	String name = null;
	if( currentLocation != null)
	{
		name = currentLocation.getName();
		if( name != null  &&  name.length() >  90)
			name = name.substring(0, 79);
			
	}
	form.lblLocation().setValue(currentLocation != null ? name : "No location selected");
	
	// Initialize component
	form.ccSelectPrinter().initialize(currentLocation, PrinterScope.DEFAULT);
	form.ccSelectPrinter().setIsRequired(Boolean.TRUE); //WDEV-17625
}
 
Example 27
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateLocalPrinters(DynamicGridCell cell) 
{
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{			
		for(int i=0;i<printers.length;i++)
		{				 
			cell.getItems().newItem(printers[i].getIPrinterName(), printers[i].getIPrinterName());				
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
		if (defaultPrinter != null)
		{					
			cell.setValue(defaultPrinter.getIPrinterName());
		}
	}	
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException
{
	/*String[] printers = domain.getCurrentLocationPrinters();
	addPrinters(printers);
	printers = domain.getCurrentLocationPrinters(true);
	addPrinters(printers);*/
	
	if (engine.getPrinterProvider() == null)
		return;
	
	IPrinter[] printers = engine.getPrinterProvider().getPrintersForLocation(domain.getCurrentLocation());
	if (printers != null)
	{			
		for(int i=0;i<printers.length;i++)
		{
			form.cmbPrinter().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
		}
		
		IPrinter defaultPrinter = engine.getPrinterProvider().getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
		if (defaultPrinter != null)
		{				
			form.cmbPrinter().setValue(defaultPrinter.getIPrinterName());
		}
	}	
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addPrinters(IPrinter[] printers)
{
	if(printers != null && printers.length > 0)
	{
		for (int i = 0; i < printers.length; i++)
		{
			form.qmbPrinter().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
			form.qmbPrinterLabels().newRow(printers[i].getIPrinterName(), printers[i].getIPrinterName());
		}
	}
	IPrinter defaultPrinter = domain.getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.DEFAULT);
	if (defaultPrinter != null)
		form.qmbPrinter().setValue(defaultPrinter.getIPrinterName());

	IPrinter labelPrinter = domain.getPrinterByLocationAndScope(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	if (labelPrinter != null)
		form.qmbPrinterLabels().setValue(labelPrinter.getIPrinterName());
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException
{
	initializeDynamicGrid();
	//WDEV-16115
	form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.NEWRESULT);
	if (form.ccPrinter().getSelectedPrinter() == null)
	{
		form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	}
	PathologyResultListShortVoCollection results = form.getGlobalContext().OCRR.getResultsForPrint();
	if (results == null)
		return;

	Integer nNewResUnseenDays = new Integer(ConfigFlag.DOM.OCS_NEWRES_UNSEEN_CUTOFF.getValue());
	Date dateUnseen = new Date().addDay(-1 * nNewResUnseenDays.intValue());

	for (int x = 0; x < results.size(); x++)
	{
		addResult(results.get(x), dateUnseen);
	}		
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	ILocation locs = domain.getCurrentLocation();
	
	form.lblLoc().setValue(locs != null ? locs.getName() : "No location selected");
	form.ccPrinter().initialize(locs, PrinterScope.DEFAULT);	
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onChkAllPrintersValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.chkAllPrinters().getValue())
	{
		form.ccServerPrinters().initialize(null, PrinterScope.DEFAULT, true);			
	}
	else
	{
		form.ccServerPrinters().initialize(engine.getCurrentLocation(), PrinterScope.DEFAULT, true);			
	}		
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialize(Object[] args) 
{
	form.getLocalContext().setCurrentLocation(domain.getCurrentLocation());
	
	//wdev-14713
	String locname = null;
	if( form.getLocalContext().getCurrentLocation() != null )
	{
		locname = form.getLocalContext().getCurrentLocation().getName();
		if( locname != null && locname.length() > 65)
			locname = locname.substring(0, 64);
	}
	form.lblLocation().setValue(form.getLocalContext().getCurrentLocation() != null ? locname : "No location selected");	//wdev-14713
	form.lblLocation().setTooltip(form.getLocalContext().getCurrentLocation() != null ? form.getLocalContext().getCurrentLocation().getName() : "No location selected"); //wdev-14713
	
	form.ccPrinter().initialize(form.getLocalContext().getCurrentLocation(), PrinterScope.DEFAULT);
	form.chkListAll().setValue(false);
	
	if(args != null && args.length > 0)
	{
		if(args[0] instanceof String)
		{
			form.getLocalContext().setCareContextSeedName((String) args[0]);
		}
		
		if(args[1] instanceof Integer)
		{
			form.getLocalContext().setCareContextSeedValue((Integer) args[1]);
		}
	}
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	
	form.ccPrinters().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT, false);		
	
	if(form.getGlobalContext().Core.getPrepareForPrintingIsNotNull() && form.getGlobalContext().Core.getPrepareForPrinting().equals(Boolean.TRUE))
	{
		form.btnPreview().setEnabled(false);
	}
	
	form.chkStoreCopy().setVisible(ConfigFlag.GEN.CREATE_NEW_PATIENTDOCUMENT_ON_PRINTREPORTDIALOG.getValue() && form.getGlobalContext().Core.getPatientShortIsNotNull());//WDEV-17772
	
	open();
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onChkAllValueChanged() throws PresentationLogicException
{
	if(form.chkAll().getValue())
	{
		form.ccPrinters().initialize(null, PrinterScope.DEFAULT);			
	}
	else
	{
		form.ccPrinters().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT);			
	}		
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialize(Object[] args)
{
	form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT,true);

	if (args != null && args.length > 0)
	{
		if(args[0] instanceof DocumentAndPatientWrapperVoCollection)
		{
			DocumentAndPatientWrapperVoCollection documents = (DocumentAndPatientWrapperVoCollection) args[0];

			populateGrid(documents);
		}
	}
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeRecord()
{						
	unsetLocalContext();
	removeSelectedRow();		
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);
	updateControlsState();
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeAllRecords()
{
	form.grdList().getRows().clear();
	clearLocalContext();
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);
	updateControlsState();
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open()
{		
	form.grdList().getRows().clear();
	
	PrinterVoCollection printers = form.getGlobalContext().getPrintersSelected();
	if (printers != null)
	{		
		for (int i = 0; i < printers.size(); i++)
		{				
			grdListRow row = form.grdList().getRows().newRow();
			row.setcolItems(printers.get(i).getName());
			row.setValue(printers.get(i));
			
			if (form.getLocalContext().getDefaultPrinterIsNotNull())
			{
				if (printers.get(i).getName().equals(form.getLocalContext().getDefaultPrinter().getIPrinterName()))
				{
					row.setColDefault(true);
				}
			}
			if (form.getLocalContext().getDesignatedPrinterForNewResultsIsNotNull())
			{
				if (printers.get(i).getName().equals(form.getLocalContext().getDesignatedPrinterForNewResults().getIPrinterName()))
				{
					row.setColDesignatedToNewResults(true);
				}
			}
			if (form.getLocalContext().getDesignatedPrinterForOCSOrderIsNotNull())
			{
				if (printers.get(i).getName().equals(form.getLocalContext().getDesignatedPrinterForOCSOrder().getIPrinterName()))
				{
					row.setColDesignatedPrinterForOCSOrder(true);
				}
			}
		}					
	}
			
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);		
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void initialize(ILocation location, PrinterScope scope)
{
	form.getLocalContext().setLocation(location);		
	//WDEV-16961 
	form.getLocalContext().setSetDefaultPrinter(null);
	form.getLocalContext().setSetNewResultsPrinter(null);
	form.getLocalContext().setSetOCSOrderPrinter(null);
	
	if (scope != null)
	{
		if (scope.equals(PrinterScope.DEFAULT))		
			form.getLocalContext().setSetDefaultPrinter(true);
		else if (scope.equals(PrinterScope.NEWRESULT))
			form.getLocalContext().setSetNewResultsPrinter(true);
		else if (scope.equals(PrinterScope.OCSORDER))
			form.getLocalContext().setSetOCSOrderPrinter(true);
	}
	
	IPrinter[] printers = null;
	if (location != null)
	{	
		if(engine.getPrinterProvider() != null)		//wdev-12582
			printers  = engine.getPrinterProvider().getPrintersForLocation(form.getLocalContext().getLocation());			
	}
	else
	{
		if(engine.getPrinterProvider() != null)		//wdev-12582
			printers = engine.getPrinterProvider().getAllPrinters();
	}
	form.getLocalContext().setPrintersLists(printers);				
	populateQueryCombo(printers, Boolean.TRUE.equals(form.getLocalContext().getShowOpened()));
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialisePrinters()
{
	ILocation locs = domain.getCurrentLocation();
	form.txtLocation().setValue(locs != null ? locs.getName() : "No location selected");

	// WDEV-12536
	form.ccPrinter().initialize(locs, PrinterScope.DEFAULT);
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	ILocation locs = domain.getCurrentLocation();
	form.lblLoc().setValue(locs != null ? locs.getName() : "No location selected");

	// WDEV-12536 - Initialise printer custom control
	form.ccPrinter().initialize(locs, PrinterScope.DEFAULT);
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException 
{	
	form.ccPrint().initialize(domain.getCurrentLocation(),PrinterScope.DEFAULT,true);
	form.ccPrint().setIsRequired(true); //WDEV-14757
	
	form.cc1().initialize(MosType.ALL);
	form.cc1().isRequired(true);//	WDEV-13691
	form.cc1().setValue(domain.getMosUser() instanceof MemberOfStaffShortVo ? (MemberOfStaffShortVo) domain.getMosUser() : null);//	WDEV-13691
	
	form.dtim1().setValue(new DateTime());
}
 
Example 44
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	ILocation locs = domain.getCurrentLocation();
	
	form.lblLoc().setValue(locs != null ? locs.getName() : "No location selected");
	form.ccPrinter().initialize(locs, PrinterScope.DEFAULT);	
}
 
Example 45
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onChkAllPrintersValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.chkAllPrinters().getValue())
	{
		form.ccServerPrinters().initialize(null, PrinterScope.DEFAULT, true);			
	}
	else
	{
		form.ccServerPrinters().initialize(engine.getCurrentLocation(), PrinterScope.DEFAULT, true);			
	}		
}
 
Example 46
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onChkSelectAllPrintersValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.chkSelectAllPrinters().getValue())
	{
		form.ccSelectPrinter().initialize(null, PrinterScope.DEFAULT);
	}
	else
	{
		form.ccSelectPrinter().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT);
	}
}
 
Example 47
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialize() throws PresentationLogicException 
{
	form.ccResponsableHCP().initialize(MosType.HCP);
	form.ccResponsableHCP().isRequired(true);
	
	form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT, false);
	
	bindEpisodesCombo();
}
 
Example 48
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialize(Object[] args) 
{
	form.getLocalContext().setCurrentLocation(domain.getCurrentLocation());
	
	//wdev-14713
	String locname = null;
	if( form.getLocalContext().getCurrentLocation() != null )
	{
		locname = form.getLocalContext().getCurrentLocation().getName();
		if( locname != null && locname.length() > 65)
			locname = locname.substring(0, 64);
	}
	form.lblLocation().setValue(form.getLocalContext().getCurrentLocation() != null ? locname : "No location selected");	//wdev-14713
	form.lblLocation().setTooltip(form.getLocalContext().getCurrentLocation() != null ? form.getLocalContext().getCurrentLocation().getName() : "No location selected"); //wdev-14713
	
	form.ccPrinter().initialize(form.getLocalContext().getCurrentLocation(), PrinterScope.DEFAULT);
	form.chkListAll().setValue(false);
	
	form.chkStoreCopy().setVisible(form.getGlobalContext().Core.getPatientShort() != null);
	
	if(args != null && args.length > 0)
	{
		if(args[0] instanceof String)
		{
			form.getLocalContext().setCareContextSeedName((String) args[0]);
		}
		
		if(args[1] instanceof Integer)
		{
			form.getLocalContext().setCareContextSeedValue((Integer) args[1]);
		}
	}
}
 
Example 49
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialise()
{
	ILocation locs = domain.getCurrentLocation();
	form.lblHospital().setValue(locs != null ? locs.getName() : "No location selected");

	form.ccPrinter().initialize(locs, PrinterScope.DEFAULT);
	form.ccPrinter().setIsRequired(true);
	form.intNumberOfCopies().setValue(1);
}
 
Example 50
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onChkAllValueChanged() throws PresentationLogicException
{
	if(form.chkAll().getValue())
	{
		form.ccPrinters().initialize(null, PrinterScope.DEFAULT);			
	}
	else
	{
		form.ccPrinters().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT);			
	}		
}
 
Example 51
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialize(Object[] args)
{
	form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT,true);

	if (args != null && args.length > 0)
	{
		if(args[0] instanceof DocumentAndPatientWrapperVoCollection)
		{
			DocumentAndPatientWrapperVoCollection documents = (DocumentAndPatientWrapperVoCollection) args[0];

			populateGrid(documents);
		}
	}
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{		
	ReportTemplateLiteVoCollection templates = domain.getTemplates(form.getGlobalContext().Scheduling.getAppointmentIds());		
	createDynamicGridColumns();
	populateReportsGrid(templates);
	
	form.ccPrinters().initialize(domain.getCurrentLocation(), PrinterScope.DEFAULT, false); //WDEV-19381
}
 
Example 53
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeRecord()
{						
	unsetLocalContext();
	removeSelectedRow();		
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);
	updateControlsState();
}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeAllRecords()
{
	form.grdList().getRows().clear();
	clearLocalContext();
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);
	updateControlsState();
}
 
Example 55
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open()
{		
	form.grdList().getRows().clear();
	
	PrinterVoCollection printers = form.getGlobalContext().getPrintersSelected();
	if (printers != null)
	{		
		for (int i = 0; i < printers.size(); i++)
		{				
			grdListRow row = form.grdList().getRows().newRow();
			row.setcolItems(printers.get(i).getName());
			row.setValue(printers.get(i));
			
			if (form.getLocalContext().getDefaultPrinterIsNotNull())
			{
				if (printers.get(i).getName().equals(form.getLocalContext().getDefaultPrinter().getIPrinterName()))
				{
					row.setColDefault(true);
				}
			}
			if (form.getLocalContext().getDesignatedPrinterForNewResultsIsNotNull())
			{
				if (printers.get(i).getName().equals(form.getLocalContext().getDesignatedPrinterForNewResults().getIPrinterName()))
				{
					row.setColDesignatedToNewResults(true);
				}
			}
			if (form.getLocalContext().getDesignatedPrinterForOCSOrderIsNotNull())
			{
				if (printers.get(i).getName().equals(form.getLocalContext().getDesignatedPrinterForOCSOrder().getIPrinterName()))
				{
					row.setColDesignatedPrinterForOCSOrder(true);
				}
			}
		}					
	}
			
	form.ccPrinters().initialize(null, PrinterScope.DEFAULT, false);		
}
 
Example 56
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public void initialize(ILocation location, PrinterScope scope)
{
	form.getLocalContext().setLocation(location);		
	//WDEV-16961 
	form.getLocalContext().setSetDefaultPrinter(null);
	form.getLocalContext().setSetNewResultsPrinter(null);
	form.getLocalContext().setSetOCSOrderPrinter(null);
	
	if (scope != null)
	{
		if (scope.equals(PrinterScope.DEFAULT))		
			form.getLocalContext().setSetDefaultPrinter(true);
		else if (scope.equals(PrinterScope.NEWRESULT))
			form.getLocalContext().setSetNewResultsPrinter(true);
		else if (scope.equals(PrinterScope.OCSORDER))
			form.getLocalContext().setSetOCSOrderPrinter(true);
	}
	
	IPrinter[] printers = null;
	if (location != null)
	{	
		if(engine.getPrinterProvider() != null)		//wdev-12582
			printers  = engine.getPrinterProvider().getPrintersForLocation(form.getLocalContext().getLocation());			
	}
	else
	{
		if(engine.getPrinterProvider() != null)		//wdev-12582
			printers = engine.getPrinterProvider().getAllPrinters();
	}
	form.getLocalContext().setPrintersLists(printers);				
	populateQueryCombo(printers, Boolean.TRUE.equals(form.getLocalContext().getShowOpened()));
}
 
Example 57
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialisePrinters()
{
	ILocation locs = domain.getCurrentLocation();
	form.txtLocation().setValue(locs != null ? locs.getName() : "No location selected");

	// WDEV-12536
	form.ccPrinter().initialize(locs, PrinterScope.DEFAULT);
}
 
Example 58
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	ILocation locs = domain.getCurrentLocation();
	form.lblLoc().setValue(locs != null ? locs.getName() : "No location selected");

	// WDEV-12536 - Initialise printer custom control
	form.ccPrinter().initialize(locs, PrinterScope.DEFAULT);
}
 
Example 59
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initializePrinterCC()
{
	ILocation selectLoc = engine.getCurrentLocation();
	setLocationLabel(selectLoc);
	form.ccPrinter().initialize(selectLoc, PrinterScope.DEFAULT);
	form.ccPrinter().setIsRequired(true);
	
}
 
Example 60
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException 
{	
	form.ccPrint().initialize(domain.getCurrentLocation(),PrinterScope.DEFAULT,true);
	form.ccPrint().setIsRequired(true); //WDEV-14757
	
	form.cc1().initialize(MosType.ALL);
	form.cc1().isRequired(true);//	WDEV-13691
	form.cc1().setValue(domain.getMosUser() instanceof MemberOfStaffShortVo ? (MemberOfStaffShortVo) domain.getMosUser() : null);//	WDEV-13691
	
	form.dtim1().setValue(new DateTime());
}