Java Code Examples for ims.core.vo.ProcedureLiteVoCollection

The following are top voted examples for showing how to use ims.core.vo.ProcedureLiteVoCollection. 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: ProceduresPerformedByHCPImpl.java   View source code 6 votes vote down vote up
public ProcedureLiteVoCollection getAvailableProcedures(String procedures, String filter) 
{
	DomainFactory factory=getDomainFactory();
	
	String query = "from Procedure as p where p.isActive = 1 ";
	
	if(filter != null && filter.length() > 0)
	{
		query += " and p.procedureName like :Proc";
	}
	if(procedures != null && procedures.length() > 0)
	{
		query += " and p.id not in (" + procedures + ") ";
	}
	
	List<?> procs=factory.find(query, new String[]{"Proc"}, new Object[]{filter + "%"});
	
	return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(procs);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 * Function used to populate the Procedures collection from procedures grid
 * on ICP tab
 * 
 * @return
 */
private ProcedureLiteVoCollection getProcedures()
{
	// Create a new procedures collection
	ProcedureLiteVoCollection procedures = new ProcedureLiteVoCollection();

	// Add each procedure to collection
	for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().ICP().grdICPProcedures().getRows().size(); i++)
	{
		ProcedureLiteVo procedure = form.ctnConfiguration().lyrICPTabs().ICP().grdICPProcedures().getRows().get(i).getValue();

		if (procedure == null)
			continue;

		procedures.add(procedure);
	}

	return procedures;
}
 
Example 3
Project: AvoinApotti   File: ICPConfigImpl.java   View source code 6 votes vote down vote up
public ProcedureLiteVoCollection listProcedures(String name)
{
	// Use StringBuilder to build the HQL query (more memory efficient)
	StringBuilder hqlQuery = new StringBuilder();
	hqlQuery.append("from Procedure as proc");

	// Declare the ArrayList for parameters names and parameters values
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();

	// Create parameters string
	if (name != null && name.length() > 0)
	{
		hqlQuery.append(" where UPPER(proc.procedureName) like :NAME");

		paramNames.add("NAME");
		paramValues.add("%" + name.toUpperCase() + "%");
	}

	// Set order mode
	hqlQuery.append(" order by UPPER(proc.procedureName) asc");

	return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(getDomainFactory().find(hqlQuery.toString(), paramNames, paramValues));
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException
{
	if(form.lyrDetails().tabListOwners().grdListOwner().getRows().size() == 0)
		return;
	
	row.getcolProcedure().clear();
	
	HcpRefVoCollection voCollHcp = new HcpRefVoCollection();
	for(int i=0;i<form.lyrDetails().tabListOwners().grdListOwner().getRows().size();i++)
		voCollHcp.add ((HcpRefVo) form.lyrDetails().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue());

	ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text);
	if(voCollProcedure != null)
	{
		for(ProcedureLiteVo voProc : voCollProcedure)
			row.getcolProcedure().newRow(voProc, voProc.getProcedureName());
		
		if(voCollProcedure.size() > 1)
			row.getcolProcedure().showOpened();
		else if(voCollProcedure.size() == 1)
			row.getcolProcedure().setValue(voCollProcedure.get(0));
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException
{
	if(form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size() == 0)
		return;
	
	row.getcolProcedure().clear();
	
	HcpRefVoCollection voCollHcp = new HcpRefVoCollection();
	for(int i=0;i<form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size();i++)
		voCollHcp.add ((HcpRefVo) form.lyrSessEdit().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue());

	ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text);
	if(voCollProcedure != null)
	{
		for(ProcedureLiteVo voProc : voCollProcedure)
			row.getcolProcedure().newRow(voProc, voProc.getProcedureName());
		
		if(voCollProcedure.size() > 1)
			row.getcolProcedure().showOpened();
		else if(voCollProcedure.size() == 1)
			row.getcolProcedure().setValue(voCollProcedure.get(0));
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addProcedures() throws PresentationLogicException
{
	
	ProcedureLiteVoCollection selectedProcedures = form.getGlobalContext().Clinical.getSelectedProcedures();
	if (selectedProcedures == null || selectedProcedures.size() == 0)
		return;
	DynamicGridRow selectedRow = form.dyngrdMain().getSelectedRow();
	if (selectedRow == null)
		throw new PresentationLogicException("A selected row was expected");
	if (selectedRow.getValue() instanceof ProcedureLiteVo)
		selectedRow = selectedRow.getParent();
	DynamicGridRow newRow = null;
	for (int i = 0 ; i < selectedProcedures.size() ; i++)
			newRow = addProcedureToGrid(selectedRow, selectedProcedures.get(i));
	
	form.getLocalContext().setCurrentEditedConsultant(getConsultantParent(selectedRow));
	form.getLocalContext().getCurrentEditedConsultant().setExpanded(true,true);
	selectedRow.setExpanded(true, true);
	form.dyngrdMain().setSelectedRow(newRow);
	updateControlState();
	if (FormMode.VIEW.equals(form.getMode()))
		form.setMode(FormMode.EDIT);

}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void doSearchAndShowInGrid() throws PresentationLogicException
{
	form.grdProcedures().getRows().clear();
	ProcedureLiteVoCollection procs = null;
	try
	{
		procs = domain.listProcedures(form.cmbSpeciality().getValue(), form.txtProcName().getValue());
	}
	catch (DomainInterfaceException e)
	{
		throw new PresentationLogicException(e);
	}
	if (procs == null || procs.size() == 0)
	{
		engine.showMessage( "No Procedures were found. Please modify your search criteria","No results", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	populateGridProceduresFromData(procs);

}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private ProcedureLiteVoCollection getSelectedProceduresFromGridProcedure()
{
	grdProceduresRowCollection rows = form.grdProcedures().getRows();
	if (rows == null || rows.size() == 0)
		return null;
	ProcedureLiteVoCollection value = new ProcedureLiteVoCollection();
	for (int i = 0; i < rows.size(); i++)
	{
		grdProceduresRow proceduresRow = rows.get(i);
		if (proceduresRow.getColumnSelect() == true)
		{
			value.add(proceduresRow.getValue());
		}
	}
	return value;

}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private ProcedureLiteVoCollection getSelectedProceduresFromGridSelectedProcedure()
{
	grdSelectedProceduresRowCollection rows = form.grdSelectedProcedures().getRows();
	if (rows == null || rows.size() == 0)
		return null;
	ProcedureLiteVoCollection value = new ProcedureLiteVoCollection();
	for (int i = 0; i < rows.size(); i++)
	{
		grdSelectedProceduresRow proceduresRow = rows.get(i);
		if (proceduresRow.getColumnSelect() == true)
		{
			value.add(proceduresRow.getValue());
		}
	}
	return value;

}
 
Example 10
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateSelectedProcedureGrid(ProcedureLiteVoCollection procedures, HashMap<ProcedureLiteVo, Integer> procCollection)
{
	form.dyngrdProcedures().getRows().clear();
	
	if(procedures == null)
		return;
	
	for(ProcedureLiteVo procedure : procedures)
	{
		if(procedure == null)
			continue;
		
		Integer numberOfSameProcedure = procCollection.get(procedure);
		
		for(int i=0; i<numberOfSameProcedure; i++)
		{
			addSelectedProcedureRow(procedure);
		}
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateProceduresQcmb(String value)
{
	form.qmbProcedure().clear();
	ProcedureLiteVoCollection listProc = domain.listProcedures(value, getListOfSelectedProcedures());
	
	if (listProc == null || listProc.size() == 0)
	{
		form.qmbProcedure().showOpened();
		return;
	}
		
	for (int i = 0 ; i < listProc.size() ; i++)
	{
		form.qmbProcedure().newRow(listProc.get(i),listProc.get(i).getProcedureName());
	}
	
	form.qmbProcedure().showOpened();
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addProcedure() 
{	
	
	ProcedureLiteVoCollection unavailableProcedures=new ProcedureLiteVoCollection();
	ProcedureLiteVoCollection associatedProcedures=new ProcedureLiteVoCollection();
	
	for (int z=0;z<form.tre().getSelectedNode().getNodes().size();z++)
	{
		associatedProcedures.add((ProcedureLiteVo) form.tre().getSelectedNode().getNodes().get(z).getValue());
	}
	form.getGlobalContext().RefMan.setAssociatedProcedures(associatedProcedures);
	for (int i=0;i<form.tre().getNodes().size();i++)
	{
		for (int j=0;j<form.tre().getNodes().get(i).getNodes().size();j++)
		{
			unavailableProcedures.add((ProcedureLiteVo) form.tre().getNodes().get(i).getNodes().get(j).getValue());
		}
	}
	form.getGlobalContext().RefMan.setunavailableProcedures(unavailableProcedures);
	
	engine.open(form.getForms().RefMan.SelectProcedure);
	
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	ProcedureLiteVoCollection showProcedures=new ProcedureLiteVoCollection();
	ProcedureLiteVoCollection procedures = domain.listProcedures();
	ProcedureLiteVoCollection existingProcedures = form.getGlobalContext().RefMan.getunavailableProcedures();
	if (existingProcedures==null)
	{
		showProcedures=procedures;
	}
	else
	{
		for (ProcedureLiteVo item: procedures)
		{
			if (!existingProcedures.contains(item))
			showProcedures.add(item);
		}
	}
	
	populateSelectProceduresGrid(showProcedures);
	populateSelectedProceduresGrid(form.getGlobalContext().RefMan.getAssociatedProcedures());
	
	
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void searchandList()
{

	String[] errors = validateUIRules();
	if (errors != null && errors.length>0)
	{
		engine.showErrors(errors);
		return;
	}
	
	ProcedureLiteVoCollection results = domain.listProcedures(form.cmbCategory().getValue(), 
		form.txtProcedureName().getValue(),form.getLocalContext().getHcpFilter()); //WDEV-14740
	//TODO up
	
	
	if (results == null)
	{
		form.grdItems().getRows().clear();
		engine.showMessage("No results", "No Procedures were found", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	populateGrid(results);
		
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateGrid(ProcedureLiteVoCollection procs)
{
	form.grdItems().getRows().clear();
	if (procs == null)
		return;
	
	for (int i=0 ; i < procs.size(); i++)
	{
		ProcedureLiteVo proc = procs.get(i);
		if (proc != null )
		{
			grdItemsRow nRow = form.grdItems().getRows().newRow();
			nRow.setcolProcedureName(proc.getProcedureName());
			nRow.setValue(proc);
		}
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbProcedureTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
	ProcedureLiteVoCollection lisResults = domain.listProcedures(value);
	form.qmbProcedure().clear();
	if (lisResults == null || lisResults.size() == 0)
		return;
	for (int i = 0; i < lisResults.size(); i++)
	{
		form.qmbProcedure().newRow(lisResults.get(i), lisResults.get(i).getProcedureName());
	}
	if (lisResults.size() == 1)
	{
		form.qmbProcedure().setValue(lisResults.get(0));
	}
	else
	{
		form.qmbProcedure().showOpened();
	}
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateProcedurecombo(ProcedureLiteVoCollection listProcedure)
{
	form.cmbProcedure().clear();
	if (listProcedure != null)
	{
		for (ProcedureLiteVo item : listProcedure)
		{
			form.cmbProcedure().newRow(item, item.getProcedureName());
		}

		if (listProcedure.size() == 1)
		{
			form.cmbProcedure().setValue(listProcedure.get(0));
			procedureSelected();
		}
		else if (listProcedure.size() > 1)
			form.cmbProcedure().showOpened();
	}
	else
	{
		clearTextControls();
	}

}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateProcedureQcombo(ProcedureLiteVoCollection listProcedure)
{
	form.qmbProcedure().clear();
	if (listProcedure != null)
	{
		for (ProcedureLiteVo item : listProcedure)
		{
			form.qmbProcedure().newRow(item, item.getProcedureName());
		}

		if (listProcedure.size() == 1)
		{
			form.qmbProcedure().setValue(listProcedure.get(0));
			procedureSelected();
		}
		else if (listProcedure.size() > 1)
			form.qmbProcedure().showOpened();
	}
	else
	{
		clearTextControls();
	}

}
 
Example 19
Project: AvoinApotti   File: PatientProceduresImpl.java   View source code 6 votes vote down vote up
/**
 * will call procedure List Impl to list procedures
 * @throws DomainInterfaceException 
 */
public ProcedureLiteVoCollection listProcedures(String filter) throws DomainInterfaceException
{
	CCIAdmin impl = (CCIAdmin)getDomainImpl(CCIAdminImpl.class);
	ProcedureLiteVoCollection coll = new ProcedureLiteVoCollection();
	IGenericItem[] items = impl.listIGenericItems(filter, CciType.PROCEDURE, true);
	if (items != null)
	{
		for ( int i = 0; i < items.length; i++)
		{
			coll.add((ProcedureLiteVo)items[i]);
		}
		return coll;
	}
	return null;
}
 
Example 20
Project: AvoinApotti   File: OperationDetailsConfigImpl.java   View source code 6 votes vote down vote up
public ProcedureLiteVoCollection listProcedures(HcpLiteVo hcp,String text) 
{
	if (hcp == null || !hcp.getID_HcpIsNotNull())
		throw new CodingRuntimeException("Provided hcp is null or doesn't have an id");
	
	String hql = "select distinct proc from ConsultantProcedureCategory as cpc left join cpc.categoryProcedures " +
			"as cp left join cp.procedures as proc where (proc.isActive = 1 and proc.id is not null  and cpc.performingHCP.id = :Hcp_Id ";
	ArrayList<String> pN =new ArrayList<String>();
	ArrayList<Object> pV = new ArrayList<Object>();
	pN.add("Hcp_Id");
	pV.add(hcp.getID_Hcp());
	if (text != null)
	{
		hql+=" and UPPER(proc.procedureName) like :name";
		pN.add("name");
		pV.add("%"+text.toUpperCase()+"%");
	}
	hql+=")";
	List<?> procedures=getDomainFactory().find(hql,pN,pV);
	
	if (procedures != null && procedures.size()>0)
		return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(procedures);
	return null;
}
 
Example 21
Project: openmaxims-linux   File: PatientProceduresImpl.java   View source code 6 votes vote down vote up
/**
 * will call procedure List Impl to list procedures
 * @throws DomainInterfaceException 
 */
public ProcedureLiteVoCollection listProcedures(String filter) throws DomainInterfaceException
{
	CCIAdmin impl = (CCIAdmin)getDomainImpl(CCIAdminImpl.class);
	ProcedureLiteVoCollection coll = new ProcedureLiteVoCollection();
	IGenericItem[] items = impl.listIGenericItems(filter, CciType.PROCEDURE, true);
	if (items != null)
	{
		for ( int i = 0; i < items.length; i++)
		{
			coll.add((ProcedureLiteVo)items[i]);
		}
		return coll;
	}
	return null;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void addProcedure() 
{	
	
	ProcedureLiteVoCollection unavailableProcedures=new ProcedureLiteVoCollection();
	ProcedureLiteVoCollection associatedProcedures=new ProcedureLiteVoCollection();
	
	for (int z=0;z<form.tre().getSelectedNode().getNodes().size();z++)
	{
		associatedProcedures.add((ProcedureLiteVo) form.tre().getSelectedNode().getNodes().get(z).getValue());
	}
	form.getGlobalContext().RefMan.setAssociatedProcedures(associatedProcedures);
	for (int i=0;i<form.tre().getNodes().size();i++)
	{
		for (int j=0;j<form.tre().getNodes().get(i).getNodes().size();j++)
		{
			unavailableProcedures.add((ProcedureLiteVo) form.tre().getNodes().get(i).getNodes().get(j).getValue());
		}
	}
	form.getGlobalContext().RefMan.setunavailableProcedures(unavailableProcedures);
	
	engine.open(form.getForms().RefMan.SelectProcedure);
	
}
 
Example 23
Project: openMAXIMS   File: ProceduresPerformedByHCPImpl.java   View source code 6 votes vote down vote up
public ProcedureLiteVoCollection getAvailableProcedures(String procedures, String filter) 
{
	DomainFactory factory=getDomainFactory();
	
	String query = "from Procedure as p where p.isActive = 1 ";
	
	if(filter != null && filter.length() > 0)
	{
		query += " and p.procedureName like :Proc";
	}
	if(procedures != null && procedures.length() > 0)
	{
		query += " and p.id not in (" + procedures + ") ";
	}
	
	List<?> procs=factory.find(query, new String[]{"Proc"}, new Object[]{filter + "%"});
	
	return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(procs);
}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
/**
 * Function used to populate the Procedures collection from procedures grid
 * on ICP tab
 * 
 * @return
 */
private ProcedureLiteVoCollection getProcedures()
{
	// Create a new procedures collection
	ProcedureLiteVoCollection procedures = new ProcedureLiteVoCollection();

	// Add each procedure to collection
	for (int i = 0; i < form.ctnConfiguration().lyrICPTabs().ICP().grdICPProcedures().getRows().size(); i++)
	{
		ProcedureLiteVo procedure = form.ctnConfiguration().lyrICPTabs().ICP().grdICPProcedures().getRows().get(i).getValue();

		if (procedure == null)
			continue;

		procedures.add(procedure);
	}

	return procedures;
}
 
Example 25
Project: openMAXIMS   File: ICPConfigImpl.java   View source code 6 votes vote down vote up
public ProcedureLiteVoCollection listProcedures(String name)
{
	// Use StringBuilder to build the HQL query (more memory efficient)
	StringBuilder hqlQuery = new StringBuilder();
	hqlQuery.append("from Procedure as proc");

	// Declare the ArrayList for parameters names and parameters values
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();

	// Create parameters string
	if (name != null && name.length() > 0)
	{
		hqlQuery.append(" where UPPER(proc.procedureName) like :NAME");

		paramNames.add("NAME");
		paramValues.add("%" + name.toUpperCase() + "%");
	}

	// Set order mode
	hqlQuery.append(" order by UPPER(proc.procedureName) asc");

	return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(getDomainFactory().find(hqlQuery.toString(), paramNames, paramValues));
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onGrdTheatreGridQueryComboBoxTextSubmited(int column, grdTheatreRow row, String text) throws PresentationLogicException
{
	if(form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size() == 0)
		return;
	
	row.getcolProcedure().clear();
	
	HcpRefVoCollection voCollHcp = new HcpRefVoCollection();
	for(int i=0;i<form.lyrSessEdit().tabListOwners().grdListOwner().getRows().size();i++)
		voCollHcp.add ((HcpRefVo) form.lyrSessEdit().tabListOwners().grdListOwner().getRows().get(i).getColHcp().getValue());

	ProcedureLiteVoCollection voCollProcedure = domain.listProcedureByHcpAndName(voCollHcp, text);
	if(voCollProcedure != null)
	{
		for(ProcedureLiteVo voProc : voCollProcedure)
			row.getcolProcedure().newRow(voProc, voProc.getProcedureName());
		
		if(voCollProcedure.size() > 1)
			row.getcolProcedure().showOpened();
		else if(voCollProcedure.size() == 1)
			row.getcolProcedure().setValue(voCollProcedure.get(0));
		else
			engine.showMessage("No matching records found");
	}
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void searchandList()
{

	String[] errors = validateUIRules();
	if (errors != null && errors.length>0)
	{
		engine.showErrors(errors);
		return;
	}
	
	ProcedureLiteVoCollection results = domain.listProcedures(form.cmbCategory().getValue(), 
		form.txtProcedureName().getValue(),form.getLocalContext().getHcpFilter()); //WDEV-14740
	//TODO up
	
	
	if (results == null)
	{
		form.grdItems().getRows().clear();
		engine.showMessage("No results", "No Procedures were found", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	populateGrid(results);
		
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void doSearchAndShowInGrid() throws PresentationLogicException
{
	form.grdProcedures().getRows().clear();
	ProcedureLiteVoCollection procs = null;
	try
	{
		procs = domain.listProcedures(form.cmbSpeciality().getValue(), form.txtProcName().getValue(),form.getLocalContext().getProceduresWithoutOutpatientOnly());	//wdev-20233
	}
	catch (DomainInterfaceException e)
	{
		throw new PresentationLogicException(e);
	}
	if (procs == null || procs.size() == 0)
	{
		engine.showMessage( "No Procedures were found. Please modify your search criteria","No results", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	populateGridProceduresFromData(procs);

}
 
Example 29
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbProcedureTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
	ProcedureLiteVoCollection lisResults = domain.listProcedures(value);
	form.qmbProcedure().clear();
	if (lisResults == null || lisResults.size() == 0)
		return;
	for (int i = 0; i < lisResults.size(); i++)
	{
		form.qmbProcedure().newRow(lisResults.get(i), lisResults.get(i).getProcedureName());
	}
	if (lisResults.size() == 1)
	{
		form.qmbProcedure().setValue(lisResults.get(0));
	}
	else
	{
		form.qmbProcedure().showOpened();
	}
}
 
Example 30
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private ProcedureLiteVoCollection getSelectedProceduresFromGridSelectedProcedure()
{
	grdSelectedProceduresRowCollection rows = form.grdSelectedProcedures().getRows();
	if (rows == null || rows.size() == 0)
		return null;
	ProcedureLiteVoCollection value = new ProcedureLiteVoCollection();
	for (int i = 0; i < rows.size(); i++)
	{
		grdSelectedProceduresRow proceduresRow = rows.get(i);
		if (proceduresRow.getColumnSelect() == true)
		{
			value.add(proceduresRow.getValue());
		}
	}
	return value;

}
 
Example 31
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void selectAllProceduresFromCheckbox() throws PresentationLogicException
{
	ProcedureLiteVoCollection procs = null;
	
	try
	{
		procs = domain.listProcedures(form.cmbSpeciality().getValue(), null, form.getLocalContext().getProceduresWithoutOutpatientOnly());	//wdev-20233
	}
	
	catch (DomainInterfaceException e)
	{
		throw new PresentationLogicException(e);
	}
	
	if (procs == null || procs.size() == 0)
	{
		form.chkAllProcedures().setValue(false);
		engine.showMessage("No Procedures were found.","No results", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	
	form.getGlobalContext().Clinical.setSelectedProcedures(procs);
	engine.close(DialogResult.OK);
}
 
Example 32
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateSecondaryProcedure(ProcedureLiteVoCollection procedures)
{
	form.qmbIntendedProcedure2().clear();
	form.cmbLaterality2().setValue(null);
	
	if (procedures == null)
		return;
	
	for (ProcedureLiteVo procedure : procedures)
	{
		form.qmbIntendedProcedure2().newRow(procedure, procedure.getProcedureName());
	}
	
	if (procedures.size() == 1)
	{
		form.qmbIntendedProcedure2().setValue(procedures.get(0));
		form.intSurgeryTime().setValue(null);
	}
	else
	{
		form.qmbIntendedProcedure2().showOpened();
	}
}
 
Example 33
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateProceduresQcmb(String value)
{
	form.qmbProcedure().clear();
	ProcedureLiteVoCollection listProc = domain.listProcedures(value, getListOfSelectedProcedures());
	
	if (listProc == null || listProc.size() == 0)
	{
		form.qmbProcedure().showOpened();
		return;
	}
		
	for (int i = 0 ; i < listProc.size() ; i++)
	{
		form.qmbProcedure().newRow(listProc.get(i),listProc.get(i).getProcedureName());
	}
	
	form.qmbProcedure().showOpened();
}
 
Example 34
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void addProcedure() 
{	
	
	ProcedureLiteVoCollection unavailableProcedures=new ProcedureLiteVoCollection();
	ProcedureLiteVoCollection associatedProcedures=new ProcedureLiteVoCollection();
	
	for (int z=0;z<form.tre().getSelectedNode().getNodes().size();z++)
	{
		associatedProcedures.add((ProcedureLiteVo) form.tre().getSelectedNode().getNodes().get(z).getValue());
	}
	form.getGlobalContext().RefMan.setAssociatedProcedures(associatedProcedures);
	for (int i=0;i<form.tre().getNodes().size();i++)
	{
		for (int j=0;j<form.tre().getNodes().get(i).getNodes().size();j++)
		{
			unavailableProcedures.add((ProcedureLiteVo) form.tre().getNodes().get(i).getNodes().get(j).getValue());
		}
	}
	form.getGlobalContext().RefMan.setunavailableProcedures(unavailableProcedures);
	
	engine.open(form.getForms().RefMan.SelectProcedure);
	
}
 
Example 35
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	ProcedureLiteVoCollection showProcedures=new ProcedureLiteVoCollection();
	ProcedureLiteVoCollection procedures = domain.listProcedures();
	ProcedureLiteVoCollection existingProcedures = form.getGlobalContext().RefMan.getunavailableProcedures();
	if (existingProcedures==null)
	{
		showProcedures=procedures;
	}
	else
	{
		for (ProcedureLiteVo item: procedures)
		{
			if (!existingProcedures.contains(item))
			showProcedures.add(item);
		}
	}
	
	populateSelectProceduresGrid(showProcedures);
	populateSelectedProceduresGrid(form.getGlobalContext().RefMan.getAssociatedProcedures());
	
	
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void doSearchAndShowInGrid() throws PresentationLogicException
{
	form.grdProcedures().getRows().clear();
	ProcedureLiteVoCollection procs = null;
	try
	{
		procs = domain.listProcedures(form.cmbSpeciality().getValue(), form.txtProcName().getValue());
	}
	catch (DomainInterfaceException e)
	{
		throw new PresentationLogicException(e);
	}
	if (procs == null || procs.size() == 0)
	{
		engine.showMessage( "No Procedures were found. Please modify your search criteria","No results", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	populateGridProceduresFromData(procs);

}
 
Example 37
Project: openmaxims-linux   File: OperationDetailsConfigImpl.java   View source code 6 votes vote down vote up
public ProcedureLiteVoCollection listProcedures(HcpLiteVo hcp,String text) 
{
	if (hcp == null || !hcp.getID_HcpIsNotNull())
		throw new CodingRuntimeException("Provided hcp is null or doesn't have an id");
	
	String hql = "select distinct proc from ConsultantProcedureCategory as cpc left join cpc.categoryProcedures " +
			"as cp left join cp.procedures as proc where (proc.isActive = 1 and proc.id is not null  and cpc.performingHCP.id = :Hcp_Id ";
	ArrayList<String> pN =new ArrayList<String>();
	ArrayList<Object> pV = new ArrayList<Object>();
	pN.add("Hcp_Id");
	pV.add(hcp.getID_Hcp());
	if (text != null)
	{
		hql+=" and UPPER(proc.procedureName) like :name";
		pN.add("name");
		pV.add("%"+text.toUpperCase()+"%");
	}
	hql+=")";
	List<?> procedures=getDomainFactory().find(hql,pN,pV);
	
	if (procedures != null && procedures.size()>0)
		return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(procedures);
	return null;
}
 
Example 38
Project: openmaxims-linux   File: ICPConfigImpl.java   View source code 6 votes vote down vote up
public ProcedureLiteVoCollection listProcedures(String name)
{
	// Use StringBuilder to build the HQL query (more memory efficient)
	StringBuilder hqlQuery = new StringBuilder();
	hqlQuery.append("from Procedure as proc");

	// Declare the ArrayList for parameters names and parameters values
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();

	// Create parameters string
	if (name != null && name.length() > 0)
	{
		hqlQuery.append(" where UPPER(proc.procedureName) like :NAME");

		paramNames.add("NAME");
		paramValues.add("%" + name.toUpperCase() + "%");
	}

	// Set order mode
	hqlQuery.append(" order by UPPER(proc.procedureName) asc");

	return ProcedureLiteVoAssembler.createProcedureLiteVoCollectionFromProcedure(getDomainFactory().find(hqlQuery.toString(), paramNames, paramValues));
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void populateGrid(ProcedureLiteVoCollection procs)
{
	form.grdItems().getRows().clear();
	if (procs == null)
		return;
	
	for (int i=0 ; i < procs.size(); i++)
	{
		ProcedureLiteVo proc = procs.get(i);
		if (proc != null )
		{
			grdItemsRow nRow = form.grdItems().getRows().newRow();
			nRow.setcolProcedureName(proc.getProcedureName());
			nRow.setValue(proc);
		}
	}
}
 
Example 40
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateGrid(ProcedureLiteVoCollection procs)
{
	form.grdItems().getRows().clear();
	if (procs == null)
		return;
	
	for (int i=0 ; i < procs.size(); i++)
	{
		ProcedureLiteVo proc = procs.get(i);
		if (proc != null )
		{
			grdItemsRow nRow = form.grdItems().getRows().newRow();
			nRow.setcolProcedureName(proc.getProcedureName());
			nRow.setValue(proc);
		}
	}
}