Java Code Examples for ims.nursing.vo.PlanOfCareListVoCollection

The following are top voted examples for showing how to use ims.nursing.vo.PlanOfCareListVoCollection. 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
private void displayTabNewActions() 
{
	form.lyr1().showtabNewActions();
	form.lyr1().tabNewActions().setHeaderVisible(true);
	form.lyr1().tabChronological().setHeaderVisible(false);
	
	form.setMode(FormMode.EDIT);
	form.lyr1().tabNewActions().grdActions().getRows().clear();;
		
	form.lyr1().tabNewActions().customAuthoring().initializeComponent();
	form.lyr1().tabNewActions().setcustomAuthoringEnabled(false);
	
	PlanOfCareListVoCollection list = domain.listPlanOfCare
		(form.getGlobalContext().Core.getCurrentCareContext());
	
	if(list != null)
	{
		for(int i = 0; i < list.size(); i++)
		{
			addNewActionRowRecord(list.get(i));
		}
	}		
}
 
Example 2
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void displayTabNewActions() 
{
	form.lyr1().showtabNewActions();
	form.lyr1().tabNewActions().setHeaderVisible(true);
	form.lyr1().tabChronological().setHeaderVisible(false);
	
	form.setMode(FormMode.EDIT);
	form.lyr1().tabNewActions().grdActions().getRows().clear();;
		
	form.lyr1().tabNewActions().customAuthoring().initializeComponent();
	form.lyr1().tabNewActions().setcustomAuthoringEnabled(false);
	
	PlanOfCareListVoCollection list = domain.listPlanOfCare
		(form.getGlobalContext().Core.getCurrentCareContext());
	
	if(list != null)
	{
		for(int i = 0; i < list.size(); i++)
		{
			addNewActionRowRecord(list.get(i));
		}
	}		
}
 
Example 3
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void displayTabNewActions() 
{
	form.lyr1().showtabNewActions();
	form.lyr1().tabNewActions().setHeaderVisible(true);
	form.lyr1().tabChronological().setHeaderVisible(false);
	
	form.setMode(FormMode.EDIT);
	form.lyr1().tabNewActions().grdActions().getRows().clear();;
		
	form.lyr1().tabNewActions().customAuthoring().initializeComponent();
	form.lyr1().tabNewActions().setcustomAuthoringEnabled(false);
	
	PlanOfCareListVoCollection list = domain.listPlanOfCare
		(form.getGlobalContext().Core.getCurrentCareContext());
	
	if(list != null)
	{
		for(int i = 0; i < list.size(); i++)
		{
			addNewActionRowRecord(list.get(i));
		}
	}		
}
 
Example 4
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void displayTabNewActions() 
{
	form.lyr1().showtabNewActions();
	form.lyr1().tabNewActions().setHeaderVisible(true);
	form.lyr1().tabChronological().setHeaderVisible(false);
	
	form.setMode(FormMode.EDIT);
	form.lyr1().tabNewActions().grdActions().getRows().clear();;
		
	form.lyr1().tabNewActions().customAuthoring().initializeComponent();
	form.lyr1().tabNewActions().setcustomAuthoringEnabled(false);
	
	PlanOfCareListVoCollection list = domain.listPlanOfCare
		(form.getGlobalContext().Core.getCurrentCareContext());
	
	if(list != null)
	{
		for(int i = 0; i < list.size(); i++)
		{
			addNewActionRowRecord(list.get(i));
		}
	}		
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listPlansOfCareByStatus(PlanOfCareStatus status)
{
	if (status != null)
	{
		PlanOfCareListVoCollection coll = domain.listPlansofCareByStatus(form.getGlobalContext().Core.getCurrentCareContext(), status);
		NursingSummaryHelper helper = new NursingSummaryHelper(form.lyrPOC().tabPocList().dyngrdPOC(), form.getImages().Core.RedSqaure, form.getImages().Core.GreenSquare, form.getImages().Core.YellowSquare, form.getImages().Core.Information, coll);
		helper.displayActionsGroupByPlan(coll, false);
		updateContextMenuState();
	}
}
 
Example 6
Project: AvoinApotti   File: NursingSummaryHelper.java   Source Code and License 5 votes vote down vote up
public void displayActionsGroupByPlan(PlanOfCareListVoCollection coll, boolean orderDesc)
{
	if(grid == null)
		throw new CodingRuntimeException("The grid was not passed down in the constructor !");
	
	clearGrid();
	createGridColumns();
	
	if (orderDesc)
	{
		sortDesc();
	}

	populateGrid(coll);
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateActions()
{
	DateTime date1 = null;
	DateTime date2 = null;
	
	if(form.cmbInterval().getValue() != null)
	{
		date1 = new DateTime();
		date2 = new DateTime();
		
		int hours = 0;
		if(PlanOfCareInterval.HOURS12.equals(form.cmbInterval().getValue()))
			hours = -12;
		else if(PlanOfCareInterval.HOURS24.equals(form.cmbInterval().getValue()))
			hours = -24;
		else if(PlanOfCareInterval.HOURS36.equals(form.cmbInterval().getValue()))
			hours = -36;
		else if(PlanOfCareInterval.HOURS48.equals(form.cmbInterval().getValue()))
			hours = -48;
		else if(PlanOfCareInterval.HOURS72.equals(form.cmbInterval().getValue()))
			hours = -72;
		
		date1.addHours(hours);
	}
	
	PlanOfCareListVoCollection coll = domain.listPlansofCare(form.getGlobalContext().Core.getCurrentCareContext(), null, date1, date2);
	NursingSummaryHelper helper = new NursingSummaryHelper(form.dyngrdActions(), form.getImages().Core.RedSqaure, form.getImages().Core.GreenSquare, form.getImages().Core.YellowSquare, form.getImages().Core.Information, coll);
	helper.displayActionsGroupByPlan(coll, false);
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listPlansOfCareByStatus(PlanOfCareStatus status)
{
	if (status != null)
	{
		PlanOfCareListVoCollection coll = domain.listPlansofCareByStatus(form.getGlobalContext().Core.getCurrentCareContext(), status);
		NursingSummaryHelper helper = new NursingSummaryHelper(form.lyrPOC().tabPocList().dyngrdPOC(), form.getImages().Core.RedSqaure, form.getImages().Core.GreenSquare, form.getImages().Core.YellowSquare, form.getImages().Core.Information, coll);
		helper.displayActionsGroupByPlan(coll, false);
		updateContextMenuState();
	}
}
 
Example 9
Project: openMAXIMS   File: NursingSummaryHelper.java   Source Code and License 5 votes vote down vote up
public void displayActionsGroupByPlan(PlanOfCareListVoCollection coll, boolean orderDesc)
{
	if(grid == null)
		throw new CodingRuntimeException("The grid was not passed down in the constructor !");
	
	clearGrid();
	createGridColumns();
	
	if (orderDesc)
	{
		sortDesc();
	}

	populateGrid(coll);
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateActions()
{
	DateTime date1 = null;
	DateTime date2 = null;
	
	if(form.cmbInterval().getValue() != null)
	{
		date1 = new DateTime();
		date2 = new DateTime();
		
		int hours = 0;
		if(PlanOfCareInterval.HOURS12.equals(form.cmbInterval().getValue()))
			hours = -12;
		else if(PlanOfCareInterval.HOURS24.equals(form.cmbInterval().getValue()))
			hours = -24;
		else if(PlanOfCareInterval.HOURS36.equals(form.cmbInterval().getValue()))
			hours = -36;
		else if(PlanOfCareInterval.HOURS48.equals(form.cmbInterval().getValue()))
			hours = -48;
		else if(PlanOfCareInterval.HOURS72.equals(form.cmbInterval().getValue()))
			hours = -72;
		
		date1.addHours(hours);
	}
	
	PlanOfCareListVoCollection coll = domain.listPlansofCare(form.getGlobalContext().Core.getCurrentCareContext(), null, date1, date2);
	NursingSummaryHelper helper = new NursingSummaryHelper(form.dyngrdActions(), form.getImages().Core.RedSqaure, form.getImages().Core.GreenSquare, form.getImages().Core.YellowSquare, form.getImages().Core.Information, coll);
	helper.displayActionsGroupByPlan(coll, false);
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listPlansOfCareByStatus(PlanOfCareStatus status)
{
	if (status != null)
	{
		PlanOfCareListVoCollection coll = domain.listPlansofCareByStatus(form.getGlobalContext().Core.getCurrentCareContext(), status);
		NursingSummaryHelper helper = new NursingSummaryHelper(form.lyrPOC().tabPocList().dyngrdPOC(), form.getImages().Core.RedSqaure, form.getImages().Core.GreenSquare, form.getImages().Core.YellowSquare, form.getImages().Core.Information, coll);
		helper.displayActionsGroupByPlan(coll, false);
		updateContextMenuState();
	}
}
 
Example 12
Project: openMAXIMS   File: NursingSummaryHelper.java   Source Code and License 5 votes vote down vote up
public void displayActionsGroupByPlan(PlanOfCareListVoCollection coll, boolean orderDesc)
{
	if(grid == null)
		throw new CodingRuntimeException("The grid was not passed down in the constructor !");
	
	clearGrid();
	createGridColumns();
	
	if (orderDesc)
	{
		sortDesc();
	}

	populateGrid(coll);
}
 
Example 13
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateActions()
{
	DateTime date1 = null;
	DateTime date2 = null;
	
	if(form.cmbInterval().getValue() != null)
	{
		date1 = new DateTime();
		date2 = new DateTime();
		
		int hours = 0;
		if(PlanOfCareInterval.HOURS12.equals(form.cmbInterval().getValue()))
			hours = -12;
		else if(PlanOfCareInterval.HOURS24.equals(form.cmbInterval().getValue()))
			hours = -24;
		else if(PlanOfCareInterval.HOURS36.equals(form.cmbInterval().getValue()))
			hours = -36;
		else if(PlanOfCareInterval.HOURS48.equals(form.cmbInterval().getValue()))
			hours = -48;
		else if(PlanOfCareInterval.HOURS72.equals(form.cmbInterval().getValue()))
			hours = -72;
		
		date1.addHours(hours);
	}
	
	PlanOfCareListVoCollection coll = domain.listPlansofCare(form.getGlobalContext().Core.getCurrentCareContext(), null, date1, date2);
	NursingSummaryHelper helper = new NursingSummaryHelper(form.dyngrdActions(), form.getImages().Core.RedSqaure, form.getImages().Core.GreenSquare, form.getImages().Core.YellowSquare, form.getImages().Core.Information, coll);
	helper.displayActionsGroupByPlan(coll, false);
}
 
Example 14
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listPlansOfCareByStatus(PlanOfCareStatus status)
{
	if (status != null)
	{
		PlanOfCareListVoCollection coll = domain.listPlansofCareByStatus(form.getGlobalContext().Core.getCurrentCareContext(), status);
		NursingSummaryHelper helper = new NursingSummaryHelper(form.lyrPOC().tabPocList().dyngrdPOC(), form.getImages().Core.RedSqaure, form.getImages().Core.GreenSquare, form.getImages().Core.YellowSquare, form.getImages().Core.Information, coll);
		helper.displayActionsGroupByPlan(coll, false);
		updateContextMenuState();
	}
}
 
Example 15
Project: openmaxims-linux   File: NursingSummaryHelper.java   Source Code and License 5 votes vote down vote up
public void displayActionsGroupByPlan(PlanOfCareListVoCollection coll, boolean orderDesc)
{
	if(grid == null)
		throw new CodingRuntimeException("The grid was not passed down in the constructor !");
	
	clearGrid();
	createGridColumns();
	
	if (orderDesc)
	{
		sortDesc();
	}

	populateGrid(coll);
}
 
Example 16
Project: AvoinApotti   File: PlanOfCareImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlansofCareByStatus(CareContextRefVo voCareContextRef, PlanOfCareStatus status) 
{
	if(voCareContextRef == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();

	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	
	hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1";
	
	if(status != null)
	{
		if (status.equals(PlanOfCareStatus.CURRENT))
		{
			condStr.append(andStr + " (p1_1.status.id ='-1089'  or p1_1.status.id='-1091')  ");
			andStr = " and ";	
		}
		else
		{
			condStr.append(andStr + " p1_1.status.id = :STATUS ");
			markers.add("STATUS");
			values.add(new Integer(status.getId()));
		
			andStr = " and ";
		}
	}
	
	condStr.append(andStr + " p1_1.careContext.id = :CONTEXT ");
	markers.add("CONTEXT");
	values.add(voCareContextRef.getID_CareContext());
	
	hql += " where ";

	hql += condStr.toString();
	hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc";
	
	return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values)));
}
 
Example 17
Project: AvoinApotti   File: PlanOfCareActionsImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlanOfCare(CareContextRefVo voCareContextRef) 
{
	return PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(
			getDomainFactory().find("from PlanOfCare as poc where poc.status.id <> -1090 and poc.careContext.id = :CARE_CONTEXT", 
					new String[] {"CARE_CONTEXT"}, new Object[] {voCareContextRef.getID_CareContext()}));
}
 
Example 18
Project: AvoinApotti   File: NursingSummaryImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlansofCare(CareContextRefVo voCareContextRef, PlanOfCareStatus status, ims.framework.utils.DateTime date1, ims.framework.utils.DateTime date2) 
{
	if(voCareContextRef == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();

	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Comparable> values = new ArrayList<Comparable>();
	
	hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1";
	
	if(status != null)
	{
		if (status.equals(PlanOfCareStatus.CURRENT))
		{
			condStr.append(andStr + " (p1_1.status.id ='-1089'  or p1_1.status.id='-1091')  ");
			andStr = " and ";	
		}
		else
		{
			condStr.append(andStr + " p1_1.status.id = :STATUS ");
			markers.add("STATUS");
			values.add(new Integer(status.getId()));
		
			andStr = " and ";
		}
	}
	
	if(date1 != null && date2 != null)
	{
		condStr.append(andStr + " p1_1.authoringInformation.authoringDateTime between :DATE1 and :DATE2 ");
		markers.add("DATE1");
		values.add(date1.getJavaDate());
		markers.add("DATE2");
		values.add(date2.getJavaDate());
		
		andStr = " and ";
	}
	
	condStr.append(andStr + " p1_1.careContext.id = :CONTEXT ");
	markers.add("CONTEXT");
	values.add(voCareContextRef.getID_CareContext());
	
	hql += " where ";

	hql += condStr.toString();
	hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc";
	
	return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values)));
}
 
Example 19
Project: openMAXIMS   File: PlanOfCareImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlansofCareByStatus(CareContextRefVo voCareContextRef, PlanOfCareStatus status) 
{
	if(voCareContextRef == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();

	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	
	hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1";
	
	if(status != null)
	{
		if (status.equals(PlanOfCareStatus.CURRENT))
		{
			condStr.append(andStr + " (p1_1.status.id ='-1089'  or p1_1.status.id='-1091')  ");
			andStr = " and ";	
		}
		else
		{
			condStr.append(andStr + " p1_1.status.id = :STATUS ");
			markers.add("STATUS");
			values.add(new Integer(status.getId()));
		
			andStr = " and ";
		}
	}
	
	condStr.append(andStr + " p1_1.careContext.id = :CONTEXT ");
	markers.add("CONTEXT");
	values.add(voCareContextRef.getID_CareContext());
	
	hql += " where ";

	hql += condStr.toString();
	hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc";
	
	return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values)));
}
 
Example 20
Project: openMAXIMS   File: PlanOfCareActionsImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlanOfCare(CareContextRefVo voCareContextRef) 
{
	return PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(
			getDomainFactory().find("from PlanOfCare as poc where poc.status.id <> -1090 and poc.careContext.id = :CARE_CONTEXT", 
					new String[] {"CARE_CONTEXT"}, new Object[] {voCareContextRef.getID_CareContext()}));
}
 
Example 21
Project: openMAXIMS   File: NursingSummaryImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlansofCare(CareContextRefVo voCareContextRef, PlanOfCareStatus status, ims.framework.utils.DateTime date1, ims.framework.utils.DateTime date2) 
{
	if(voCareContextRef == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();

	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Comparable> values = new ArrayList<Comparable>();
	
	hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1";
	
	if(status != null)
	{
		if (status.equals(PlanOfCareStatus.CURRENT))
		{
			condStr.append(andStr + " (p1_1.status.id ='-1089'  or p1_1.status.id='-1091')  ");
			andStr = " and ";	
		}
		else
		{
			condStr.append(andStr + " p1_1.status.id = :STATUS ");
			markers.add("STATUS");
			values.add(new Integer(status.getId()));
		
			andStr = " and ";
		}
	}
	
	if(date1 != null && date2 != null)
	{
		condStr.append(andStr + " p1_1.authoringInformation.authoringDateTime between :DATE1 and :DATE2 ");
		markers.add("DATE1");
		values.add(date1.getJavaDate());
		markers.add("DATE2");
		values.add(date2.getJavaDate());
		
		andStr = " and ";
	}
	
	condStr.append(andStr + " p1_1.careContext.id = :CONTEXT ");
	markers.add("CONTEXT");
	values.add(voCareContextRef.getID_CareContext());
	
	hql += " where ";

	hql += condStr.toString();
	hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc";
	
	return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values)));
}
 
Example 22
Project: openMAXIMS   File: PlanOfCareImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlansofCareByStatus(CareContextRefVo voCareContextRef, PlanOfCareStatus status) 
{
	if(voCareContextRef == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();

	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	
	hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1";
	
	if(status != null)
	{
		if (status.equals(PlanOfCareStatus.CURRENT))
		{
			condStr.append(andStr + " (p1_1.status.id ='-1089'  or p1_1.status.id='-1091')  ");
			andStr = " and ";	
		}
		else
		{
			condStr.append(andStr + " p1_1.status.id = :STATUS ");
			markers.add("STATUS");
			values.add(new Integer(status.getId()));
		
			andStr = " and ";
		}
	}
	
	condStr.append(andStr + " p1_1.careContext.id = :CONTEXT ");
	markers.add("CONTEXT");
	values.add(voCareContextRef.getID_CareContext());
	
	hql += " where ";

	hql += condStr.toString();
	hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc";
	
	return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values)));
}
 
Example 23
Project: openMAXIMS   File: PlanOfCareActionsImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlanOfCare(CareContextRefVo voCareContextRef) 
{
	return PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(
			getDomainFactory().find("from PlanOfCare as poc where poc.status.id <> -1090 and poc.careContext.id = :CARE_CONTEXT", 
					new String[] {"CARE_CONTEXT"}, new Object[] {voCareContextRef.getID_CareContext()}));
}
 
Example 24
Project: openMAXIMS   File: NursingSummaryImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlansofCare(CareContextRefVo voCareContextRef, PlanOfCareStatus status, ims.framework.utils.DateTime date1, ims.framework.utils.DateTime date2) 
{
	if(voCareContextRef == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();

	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Comparable> values = new ArrayList<Comparable>();
	
	hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1";
	
	if(status != null)
	{
		if (status.equals(PlanOfCareStatus.CURRENT))
		{
			condStr.append(andStr + " (p1_1.status.id ='-1089'  or p1_1.status.id='-1091')  ");
			andStr = " and ";	
		}
		else
		{
			condStr.append(andStr + " p1_1.status.id = :STATUS ");
			markers.add("STATUS");
			values.add(new Integer(status.getId()));
		
			andStr = " and ";
		}
	}
	
	if(date1 != null && date2 != null)
	{
		condStr.append(andStr + " p1_1.authoringInformation.authoringDateTime between :DATE1 and :DATE2 ");
		markers.add("DATE1");
		values.add(date1.getJavaDate());
		markers.add("DATE2");
		values.add(date2.getJavaDate());
		
		andStr = " and ";
	}
	
	condStr.append(andStr + " p1_1.careContext.id = :CONTEXT ");
	markers.add("CONTEXT");
	values.add(voCareContextRef.getID_CareContext());
	
	hql += " where ";

	hql += condStr.toString();
	hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc";
	
	return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values)));
}
 
Example 25
Project: openmaxims-linux   File: PlanOfCareImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlansofCareByStatus(CareContextRefVo voCareContextRef, PlanOfCareStatus status) 
{
	if(voCareContextRef == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();

	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	
	hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1";
	
	if(status != null)
	{
		if (status.equals(PlanOfCareStatus.CURRENT))
		{
			condStr.append(andStr + " (p1_1.status.id ='-1089'  or p1_1.status.id='-1091')  ");
			andStr = " and ";	
		}
		else
		{
			condStr.append(andStr + " p1_1.status.id = :STATUS ");
			markers.add("STATUS");
			values.add(new Integer(status.getId()));
		
			andStr = " and ";
		}
	}
	
	condStr.append(andStr + " p1_1.careContext.id = :CONTEXT ");
	markers.add("CONTEXT");
	values.add(voCareContextRef.getID_CareContext());
	
	hql += " where ";

	hql += condStr.toString();
	hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc";
	
	return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values)));
}
 
Example 26
Project: openmaxims-linux   File: PlanOfCareActionsImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlanOfCare(CareContextRefVo voCareContextRef) 
{
	return PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(
			getDomainFactory().find("from PlanOfCare as poc where poc.status.id <> -1090 and poc.careContext.id = :CARE_CONTEXT", 
					new String[] {"CARE_CONTEXT"}, new Object[] {voCareContextRef.getID_CareContext()}));
}
 
Example 27
Project: openmaxims-linux   File: NursingSummaryImpl.java   Source Code and License 4 votes vote down vote up
public PlanOfCareListVoCollection listPlansofCare(CareContextRefVo voCareContextRef, PlanOfCareStatus status, ims.framework.utils.DateTime date1, ims.framework.utils.DateTime date2) 
{
	if(voCareContextRef == null)
		throw new CodingRuntimeException("The 'careContext' parameter cannot be null !");
	
	DomainFactory factory = getDomainFactory();
	
	String hql = new String();

	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Comparable> values = new ArrayList<Comparable>();
	
	hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1";
	
	if(status != null)
	{
		if (status.equals(PlanOfCareStatus.CURRENT))
		{
			condStr.append(andStr + " (p1_1.status.id ='-1089'  or p1_1.status.id='-1091')  ");
			andStr = " and ";	
		}
		else
		{
			condStr.append(andStr + " p1_1.status.id = :STATUS ");
			markers.add("STATUS");
			values.add(new Integer(status.getId()));
		
			andStr = " and ";
		}
	}
	
	if(date1 != null && date2 != null)
	{
		condStr.append(andStr + " p1_1.authoringInformation.authoringDateTime between :DATE1 and :DATE2 ");
		markers.add("DATE1");
		values.add(date1.getJavaDate());
		markers.add("DATE2");
		values.add(date2.getJavaDate());
		
		andStr = " and ";
	}
	
	condStr.append(andStr + " p1_1.careContext.id = :CONTEXT ");
	markers.add("CONTEXT");
	values.add(voCareContextRef.getID_CareContext());
	
	hql += " where ";

	hql += condStr.toString();
	hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc";
	
	return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values)));
}