Java Code Examples for ims.coe.vo.RiskAssessmentCollection

The following are top voted examples for showing how to use ims.coe.vo.RiskAssessmentCollection. 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   View source code 6 votes vote down vote up
private boolean getBradenAssessment()
{
	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();

	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return false;
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	return true;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isAnswerMandatory(String name)
{
	RiskAssessmentCollection risks = form.getGlobalContext().Nursing.getWaterlowAssessments();
	
	if(risks == null)
	{
		return false;
	}
	
	for(int i = 0; i < risks.size(); i++)
	{
		RiskAssessment risk = risks.get(i);
		
		if(risk.getName().equalsIgnoreCase(name))
			return risk.getMandatoryAnswer().booleanValue();
	}
	
	return false; 
}
 
Example 3
Project: AvoinApotti   File: PatientSummaryOverviewImpl.java   View source code 6 votes vote down vote up
private String calculateScore(WaterlowAssessmentDetailsVoCollection assessmentDetails, RiskAssessmentCollection risks)
{
	int score = 0;
	for (int i = 0 ; i < risks.size() ; i++)
	{
		if (!risks.get(i).getRiskFactorsIsNotNull())
			continue;
		for (int x = 0 ; x < risks.get(i).getRiskFactors().size() ; x++)
		{
   			
   			for (int j = 0 ; j < assessmentDetails.size() ; j++)
   			{ 
   				if (assessmentDetails.get(j).getSelectIsNotNull() && assessmentDetails.get(j).getSelect() && risks.get(i).getRiskFactors().get(x).getId().equals(String.valueOf(assessmentDetails.get(j).getAssessment())))
   				{
   					score+=Integer.valueOf(risks.get(i).getRiskFactors().get(x).getScore());
   				}
   			}
		}
	}
	return String.valueOf(score);
}
 
Example 4
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean getBradenAssessment()
{
	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();

	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return false;
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	return true;
}
 
Example 5
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isAnswerMandatory(String name)
{
	RiskAssessmentCollection risks = form.getGlobalContext().Nursing.getWaterlowAssessments();
	
	if(risks == null)
	{
		return false;
	}
	
	for(int i = 0; i < risks.size(); i++)
	{
		RiskAssessment risk = risks.get(i);
		
		if(risk.getName().equalsIgnoreCase(name))
			return risk.getMandatoryAnswer().booleanValue();
	}
	
	return false; 
}
 
Example 6
Project: openMAXIMS   File: PatientSummaryOverviewImpl.java   View source code 6 votes vote down vote up
private String calculateScore(WaterlowAssessmentDetailsVoCollection assessmentDetails, RiskAssessmentCollection risks)
{
	int score = 0;
	for (int i = 0 ; i < risks.size() ; i++)
	{
		if (!risks.get(i).getRiskFactorsIsNotNull())
			continue;
		for (int x = 0 ; x < risks.get(i).getRiskFactors().size() ; x++)
		{
   			
   			for (int j = 0 ; j < assessmentDetails.size() ; j++)
   			{ 
   				if (assessmentDetails.get(j).getSelectIsNotNull() && assessmentDetails.get(j).getSelect() && risks.get(i).getRiskFactors().get(x).getId().equals(String.valueOf(assessmentDetails.get(j).getAssessment())))
   				{
   					score+=Integer.valueOf(risks.get(i).getRiskFactors().get(x).getScore());
   				}
   			}
		}
	}
	return String.valueOf(score);
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean getBradenAssessment()
{
	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();

	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return false;
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	return true;
}
 
Example 8
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isAnswerMandatory(String name)
{
	RiskAssessmentCollection risks = form.getGlobalContext().Nursing.getWaterlowAssessments();
	
	if(risks == null)
	{
		return false;
	}
	
	for(int i = 0; i < risks.size(); i++)
	{
		RiskAssessment risk = risks.get(i);
		
		if(risk.getName().equalsIgnoreCase(name))
			return risk.getMandatoryAnswer().booleanValue();
	}
	
	return false; 
}
 
Example 9
Project: openMAXIMS   File: PatientSummaryOverviewImpl.java   View source code 6 votes vote down vote up
private String calculateScore(WaterlowAssessmentDetailsVoCollection assessmentDetails, RiskAssessmentCollection risks)
{
	int score = 0;
	for (int i = 0 ; i < risks.size() ; i++)
	{
		if (!risks.get(i).getRiskFactorsIsNotNull())
			continue;
		for (int x = 0 ; x < risks.get(i).getRiskFactors().size() ; x++)
		{
   			
   			for (int j = 0 ; j < assessmentDetails.size() ; j++)
   			{ 
   				if (assessmentDetails.get(j).getSelectIsNotNull() && assessmentDetails.get(j).getSelect() && risks.get(i).getRiskFactors().get(x).getId().equals(String.valueOf(assessmentDetails.get(j).getAssessment())))
   				{
   					score+=Integer.valueOf(risks.get(i).getRiskFactors().get(x).getScore());
   				}
   			}
		}
	}
	return String.valueOf(score);
}
 
Example 10
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean getBradenAssessment()
{
	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();

	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return false;
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	return true;
}
 
Example 11
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean isAnswerMandatory(String name)
{
	RiskAssessmentCollection risks = form.getGlobalContext().Nursing.getWaterlowAssessments();
	
	if(risks == null)
	{
		return false;
	}
	
	for(int i = 0; i < risks.size(); i++)
	{
		RiskAssessment risk = risks.get(i);
		
		if(risk.getName().equalsIgnoreCase(name))
			return risk.getMandatoryAnswer().booleanValue();
	}
	
	return false; 
}
 
Example 12
Project: openmaxims-linux   File: PatientSummaryOverviewImpl.java   View source code 6 votes vote down vote up
private String calculateScore(WaterlowAssessmentDetailsVoCollection assessmentDetails, RiskAssessmentCollection risks)
{
	int score = 0;
	for (int i = 0 ; i < risks.size() ; i++)
	{
		if (!risks.get(i).getRiskFactorsIsNotNull())
			continue;
		for (int x = 0 ; x < risks.get(i).getRiskFactors().size() ; x++)
		{
   			
   			for (int j = 0 ; j < assessmentDetails.size() ; j++)
   			{ 
   				if (assessmentDetails.get(j).getSelectIsNotNull() && assessmentDetails.get(j).getSelect() && risks.get(i).getRiskFactors().get(x).getId().equals(String.valueOf(assessmentDetails.get(j).getAssessment())))
   				{
   					score+=Integer.valueOf(risks.get(i).getRiskFactors().get(x).getScore());
   				}
   			}
		}
	}
	return String.valueOf(score);
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onLnkNutritionalRiskAssessmentClick() throws PresentationLogicException 
{
	RiskAssessmentCollection risks = form.getGlobalContext().Nursing.getNutritionalRiskAssessments();
	
	if(risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getNutritionalRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return;
		}
		form.getGlobalContext().Nursing.setNutritionalRiskAssessments(risks);
	}

	NurAssessmentEatingVo voEat = this.populateDataFromScreen();
	if (voEat == null)
		return;

	form.getGlobalContext().Nursing.setAssessmentComponent(voEat);	
	form.getGlobalContext().Nursing.setDisplayScore(Boolean.TRUE);

	if (voEat.getNutritionalRiskAssessment() !=  null)
		form.getGlobalContext().Nursing.setNutritionalRiskRecord(voEat.getNutritionalRiskAssessment());
	
	form.getGlobalContext().Nursing.setEdit(new Boolean(!form.chkSectionComplete().getValue()));
					
	engine.open(form.getForms().Nursing.NutritionalRiskAssessmentDialog);
}
 
Example 14
Project: AvoinApotti   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws PresentationLogicException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	if(doc == null)
		return risks;
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
		risk.setMandatoryAnswer(new Boolean(attribute.valueOf("@mandatory").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onLinkBSClick() throws PresentationLogicException
{
	AssessmentSkin assessSkin = loadDataFromScreen();
	if (assessSkin == null)
		return;

	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();
	form.getGlobalContext().Nursing.setAssessmentHeaderInfo(form.getLocalContext().getAssmnt());
	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			throw new PresentationLogicException("DocumentException occurred loading BS Risks " + e.getMessage(), e);
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	form.getGlobalContext().Nursing.setAssessmentComponent(assessSkin);

	// Set MNA in context
	if (assessSkin.getBradenScale() != null)
		form.getGlobalContext().COE.setBradenScaleRecord(assessSkin.getBradenScale());

	form.getGlobalContext().COE.setDisplayScore(Boolean.TRUE);
	engine.open(form.getForms().Nursing.BradenScaleDialog);
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onLinkMNAClick() throws PresentationLogicException 
{
	AssessmentEatingAndDrinking assessEat = loadDataFromScreen();
	if (assessEat == null)
		return;

	RiskAssessmentCollection risks = form.getGlobalContext().COE.getMNAAssessments();
	
	if(risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getMNARisks();
			form.getGlobalContext().COE.setMNAAssessments(risks);
		}
		catch (PresentationLogicException e)
		{
			throw new PresentationLogicException("DocumentException occurred loading risks", e);
		}
		form.getGlobalContext().COE.setMNAAssessments(risks);
	}

	
	form.getGlobalContext().Nursing.setAssessmentComponent(assessEat);
	
	//Set MNA in context
	if (assessEat.getMiniNutritionalAssessment() !=  null)
		form.getGlobalContext().COE.setMNARecord(assessEat.getMiniNutritionalAssessment());
	
	form.getGlobalContext().COE.setDisplayScore(Boolean.TRUE);
	engine.open(form.getForms().Nursing.MNAInput);
}
 
Example 17
Project: AvoinApotti   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws DocumentException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 18
Project: AvoinApotti   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws PresentationLogicException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	if(doc == null)
		return risks;
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
		risk.setMandatoryAnswer(new Boolean(attribute.valueOf("@mandatory").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onLnkNutritionalRiskAssessmentClick() throws PresentationLogicException 
{
	RiskAssessmentCollection risks = form.getGlobalContext().Nursing.getNutritionalRiskAssessments();
	
	if(risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getNutritionalRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return;
		}
		form.getGlobalContext().Nursing.setNutritionalRiskAssessments(risks);
	}

	NurAssessmentEatingVo voEat = this.populateDataFromScreen();
	if (voEat == null)
		return;

	form.getGlobalContext().Nursing.setAssessmentComponent(voEat);	
	form.getGlobalContext().Nursing.setDisplayScore(Boolean.TRUE);

	if (voEat.getNutritionalRiskAssessment() !=  null)
		form.getGlobalContext().Nursing.setNutritionalRiskRecord(voEat.getNutritionalRiskAssessment());
	
	form.getGlobalContext().Nursing.setEdit(new Boolean(!form.chkSectionComplete().getValue()));
					
	engine.open(form.getForms().Nursing.NutritionalRiskAssessmentDialog);
}
 
Example 20
Project: openMAXIMS   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws PresentationLogicException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	if(doc == null)
		return risks;
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
		risk.setMandatoryAnswer(new Boolean(attribute.valueOf("@mandatory").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onLinkBSClick() throws PresentationLogicException
{
	AssessmentSkin assessSkin = loadDataFromScreen();
	if (assessSkin == null)
		return;

	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();
	form.getGlobalContext().Nursing.setAssessmentHeaderInfo(form.getLocalContext().getAssmnt());
	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			throw new PresentationLogicException("DocumentException occurred loading BS Risks " + e.getMessage(), e);
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	form.getGlobalContext().Nursing.setAssessmentComponent(assessSkin);

	// Set MNA in context
	if (assessSkin.getBradenScale() != null)
		form.getGlobalContext().COE.setBradenScaleRecord(assessSkin.getBradenScale());

	form.getGlobalContext().COE.setDisplayScore(Boolean.TRUE);
	engine.open(form.getForms().Nursing.BradenScaleDialog);
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onLinkMNAClick() throws PresentationLogicException 
{
	AssessmentEatingAndDrinking assessEat = loadDataFromScreen();
	if (assessEat == null)
		return;

	RiskAssessmentCollection risks = form.getGlobalContext().COE.getMNAAssessments();
	
	if(risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getMNARisks();
			form.getGlobalContext().COE.setMNAAssessments(risks);
		}
		catch (PresentationLogicException e)
		{
			throw new PresentationLogicException("DocumentException occurred loading risks", e);
		}
		form.getGlobalContext().COE.setMNAAssessments(risks);
	}

	
	form.getGlobalContext().Nursing.setAssessmentComponent(assessEat);
	
	//Set MNA in context
	if (assessEat.getMiniNutritionalAssessment() !=  null)
		form.getGlobalContext().COE.setMNARecord(assessEat.getMiniNutritionalAssessment());
	
	form.getGlobalContext().COE.setDisplayScore(Boolean.TRUE);
	engine.open(form.getForms().Nursing.MNAInput);
}
 
Example 23
Project: openMAXIMS   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws DocumentException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 24
Project: openMAXIMS   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws PresentationLogicException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	if(doc == null)
		return risks;
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
		risk.setMandatoryAnswer(new Boolean(attribute.valueOf("@mandatory").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onLnkNutritionalRiskAssessmentClick() throws PresentationLogicException 
{
	RiskAssessmentCollection risks = form.getGlobalContext().Nursing.getNutritionalRiskAssessments();
	
	if(risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getNutritionalRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return;
		}
		form.getGlobalContext().Nursing.setNutritionalRiskAssessments(risks);
	}

	NurAssessmentEatingVo voEat = this.populateDataFromScreen();
	if (voEat == null)
		return;

	form.getGlobalContext().Nursing.setAssessmentComponent(voEat);	
	form.getGlobalContext().Nursing.setDisplayScore(Boolean.TRUE);

	if (voEat.getNutritionalRiskAssessment() !=  null)
		form.getGlobalContext().Nursing.setNutritionalRiskRecord(voEat.getNutritionalRiskAssessment());
	
	form.getGlobalContext().Nursing.setEdit(new Boolean(!form.chkSectionComplete().getValue()));
					
	engine.open(form.getForms().Nursing.NutritionalRiskAssessmentDialog);
}
 
Example 26
Project: openMAXIMS   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws PresentationLogicException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	if(doc == null)
		return risks;
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
		risk.setMandatoryAnswer(new Boolean(attribute.valueOf("@mandatory").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onLinkBSClick() throws PresentationLogicException
{
	AssessmentSkin assessSkin = loadDataFromScreen();
	if (assessSkin == null)
		return;

	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();
	form.getGlobalContext().Nursing.setAssessmentHeaderInfo(form.getLocalContext().getAssmnt());
	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			throw new PresentationLogicException("DocumentException occurred loading BS Risks " + e.getMessage(), e);
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	form.getGlobalContext().Nursing.setAssessmentComponent(assessSkin);

	// Set MNA in context
	if (assessSkin.getBradenScale() != null)
		form.getGlobalContext().COE.setBradenScaleRecord(assessSkin.getBradenScale());

	form.getGlobalContext().COE.setDisplayScore(Boolean.TRUE);
	engine.open(form.getForms().Nursing.BradenScaleDialog);
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onLinkMNAClick() throws PresentationLogicException 
{
	AssessmentEatingAndDrinking assessEat = loadDataFromScreen();
	if (assessEat == null)
		return;

	RiskAssessmentCollection risks = form.getGlobalContext().COE.getMNAAssessments();
	
	if(risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getMNARisks();
			form.getGlobalContext().COE.setMNAAssessments(risks);
		}
		catch (PresentationLogicException e)
		{
			throw new PresentationLogicException("DocumentException occurred loading risks", e);
		}
		form.getGlobalContext().COE.setMNAAssessments(risks);
	}

	
	form.getGlobalContext().Nursing.setAssessmentComponent(assessEat);
	
	//Set MNA in context
	if (assessEat.getMiniNutritionalAssessment() !=  null)
		form.getGlobalContext().COE.setMNARecord(assessEat.getMiniNutritionalAssessment());
	
	form.getGlobalContext().COE.setDisplayScore(Boolean.TRUE);
	engine.open(form.getForms().Nursing.MNAInput);
}
 
Example 29
Project: openMAXIMS   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws DocumentException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 30
Project: openMAXIMS   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws PresentationLogicException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	if(doc == null)
		return risks;
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
		risk.setMandatoryAnswer(new Boolean(attribute.valueOf("@mandatory").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
protected void onLnkNutritionalRiskAssessmentClick() throws PresentationLogicException 
{
	RiskAssessmentCollection risks = form.getGlobalContext().Nursing.getNutritionalRiskAssessments();
	
	if(risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getNutritionalRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return;
		}
		form.getGlobalContext().Nursing.setNutritionalRiskAssessments(risks);
	}

	NurAssessmentEatingVo voEat = this.populateDataFromScreen();
	if (voEat == null)
		return;

	form.getGlobalContext().Nursing.setAssessmentComponent(voEat);	
	form.getGlobalContext().Nursing.setDisplayScore(Boolean.TRUE);

	if (voEat.getNutritionalRiskAssessment() !=  null)
		form.getGlobalContext().Nursing.setNutritionalRiskRecord(voEat.getNutritionalRiskAssessment());
	
	form.getGlobalContext().Nursing.setEdit(new Boolean(!form.chkSectionComplete().getValue()));
					
	engine.open(form.getForms().Nursing.NutritionalRiskAssessmentDialog);
}
 
Example 32
Project: openmaxims-linux   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws PresentationLogicException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	if(doc == null)
		return risks;
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
		risk.setMandatoryAnswer(new Boolean(attribute.valueOf("@mandatory").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
protected void onLinkBSClick() throws PresentationLogicException
{
	AssessmentSkin assessSkin = loadDataFromScreen();
	if (assessSkin == null)
		return;

	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();
	form.getGlobalContext().Nursing.setAssessmentHeaderInfo(form.getLocalContext().getAssmnt());
	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			throw new PresentationLogicException("DocumentException occurred loading BS Risks " + e.getMessage(), e);
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	form.getGlobalContext().Nursing.setAssessmentComponent(assessSkin);

	// Set MNA in context
	if (assessSkin.getBradenScale() != null)
		form.getGlobalContext().COE.setBradenScaleRecord(assessSkin.getBradenScale());

	form.getGlobalContext().COE.setDisplayScore(Boolean.TRUE);
	engine.open(form.getForms().Nursing.BradenScaleDialog);
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
protected void onLinkMNAClick() throws PresentationLogicException 
{
	AssessmentEatingAndDrinking assessEat = loadDataFromScreen();
	if (assessEat == null)
		return;

	RiskAssessmentCollection risks = form.getGlobalContext().COE.getMNAAssessments();
	
	if(risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getMNARisks();
			form.getGlobalContext().COE.setMNAAssessments(risks);
		}
		catch (PresentationLogicException e)
		{
			throw new PresentationLogicException("DocumentException occurred loading risks", e);
		}
		form.getGlobalContext().COE.setMNAAssessments(risks);
	}

	
	form.getGlobalContext().Nursing.setAssessmentComponent(assessEat);
	
	//Set MNA in context
	if (assessEat.getMiniNutritionalAssessment() !=  null)
		form.getGlobalContext().COE.setMNARecord(assessEat.getMiniNutritionalAssessment());
	
	form.getGlobalContext().COE.setDisplayScore(Boolean.TRUE);
	engine.open(form.getForms().Nursing.MNAInput);
}
 
Example 35
Project: openmaxims-linux   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws DocumentException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 36
Project: openmaxims-linux   File: RiskAssessmentHelper.java   View source code 5 votes vote down vote up
private static synchronized RiskAssessmentCollection populateRisks(String fileName) throws PresentationLogicException
{	
	Document doc = getXmlDocument(fileName);
	
	RiskAssessmentCollection risks = new RiskAssessmentCollection();
	if(doc == null)
		return risks;
	List list = doc.selectNodes("//risk_factors/risk_factor[@*]");
	for (Iterator iter = list.iterator(); iter.hasNext();)
	{
		DefaultElement attribute = (DefaultElement) iter.next();

		RiskAssessment risk = new RiskAssessment();
		RiskDescriptionCollection coll = new RiskDescriptionCollection();
		risk.setName(attribute.valueOf("@name"));
		risk.setDescription(attribute.valueOf("@description"));
		risk.setMultiple(new Boolean(attribute.valueOf("@multiple").equalsIgnoreCase("Y")));
		risk.setMandatoryAnswer(new Boolean(attribute.valueOf("@mandatory").equalsIgnoreCase("Y")));
			
		List desc = attribute.selectNodes("description[@*]");
			
		for (Iterator it = desc.iterator(); it.hasNext();)
		{
			RiskDescription descr = new RiskDescription();
					
			DefaultElement description = (DefaultElement) it.next();
			descr.setId(description.valueOf("@id"));
			descr.setName(description.valueOf("@name"));
			descr.setScore(description.valueOf("@score"));
			descr.setDescription(description.valueOf("@description"));
			coll.add(descr);
		}
		risk.setRiskFactors(coll);
				
		risks.add(risk);
	}
	
	return risks;
}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private boolean getBradenAssessment()
{
	RiskAssessmentCollection risks = form.getGlobalContext().COE.getBradenAssessments();

	if (risks == null)
	{
		try
		{
			risks = ims.nursing.helper.RiskAssessmentHelper.getBSRisks();
		}
		catch (PresentationLogicException e)
		{
			engine.showMessage(e.getMessage());
			return false;
		}
		form.getGlobalContext().COE.setBradenAssessments(risks);
	}

	form.gridBraden().getRows().clear();
	// Date/time
	GenForm.gridBradenRow row = form.gridBraden().getRows().newRow();
	row.setColFall("Date/Time");
	row.setBold(true);
	row.setBackColor(Color.Beige);
	row = form.gridBraden().getRows().newRow();
	row.setColFall("HCP");
	row.setBold(true);
	row.setBackColor(Color.Beige);

	form.gridAssessments().getRows().clear();
	GenForm.gridAssessmentsRow ar = form.gridAssessments().getRows().newRow();
	ar.setBold(true);
	ar.setBackColor(Color.Beige);
	ar = form.gridAssessments().getRows().newRow();
	ar.setBold(true);
	ar.setBackColor(Color.Beige);

	for (int i = 0; i < risks.size(); i++)
	{
		RiskAssessment risk = risks.get(i);

		row = form.gridBraden().getRows().newRow();
		row.setColFall(risk.getName());

		ar = form.gridAssessments().getRows().newRow();
	}

	row = form.gridBraden().getRows().newRow();
	row.setColFall("TOTAL");
	row.setTooltip("<b>Very Low risk:</b> > 18<br> <b>At risk:</b> 15-18<br><b>Moderate risk:</b> 13-14<br><b>High risk:</b> 10-12<br><b>Very High risk:</b> < 9");
	row.setBold(true);
	row.setBackColor(Color.Beige);

	ar = form.gridAssessments().getRows().newRow();
	ar.setBold(true);
	ar.setBackColor(Color.Beige);

	return true;
}
 
Example 38
Project: AvoinApotti   File: RiskAssessmentHelper.java   View source code 4 votes vote down vote up
public  static RiskAssessmentCollection getMNARisks() throws PresentationLogicException
{
	return populateRisks("mna.xml"); 
}
 
Example 39
Project: AvoinApotti   File: RiskAssessmentHelper.java   View source code 4 votes vote down vote up
public static RiskAssessmentCollection getBSRisks() throws PresentationLogicException
{
	return populateRisks("bradenscale.xml");
}
 
Example 40
Project: AvoinApotti   File: RiskAssessmentHelper.java   View source code 4 votes vote down vote up
public static RiskAssessmentCollection getFARisks() throws PresentationLogicException
{
	return populateRisks("fallassessmentview.xml");
}