Java Code Examples for ims.vo.ValueObjectRef

The following are top voted examples for showing how to use ims.vo.ValueObjectRef. 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: DynamicAssessmentsImpl.java   Source Code and License 6 votes vote down vote up
public String getLinkedReportName(ims.vo.ValueObjectRef refVo)
{
	if (refVo == null)
		return null;

	if(refVo instanceof UserAssessmentRefVo)
	{
		List list = getDomainFactory().find("select u1_1.associatedReport.name from UserAssessment as u1_1 where (u1_1.id = :ID)", new String[] {"ID"}, new Object[] {new Integer(refVo.getBoId())});
		
		if(list != null && list.size() > 0)
		{
			return (String) list.get(0);
		}
		
		return null;			
	}
	else if(refVo instanceof GraphicAssessmentRefVo)
	{
		return null;
	}
	
	return null;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdAssessmentsSelectionChanged() throws PresentationLogicException
{
	Object val;
	if (form.treNav().getSelectedNode() != null)
	{
		val = form.treNav().getSelectedNode().getValue();
		if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.grdAssessments().getValue();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.grdAssessments().getSelectedRow().getAssessmentName());
			populateNavigation(form.getLocalContext().getSelectedNav());
		}
	}
	form.grdAssessments().setEnabled(false);
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if(formName.equals(form.getForms().Core.ReportTemplate) && result.equals(DialogResult.OK))
	{
		Object val = form.treNav().getValue();
		
		AppNavFormVo navForm = addAppNavFormVo(getReportViewerForm(), val);
		if (navForm != null)
		{
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.getGlobalContext().Core.getReportTemplateRef();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
			populateNavigation(form.getLocalContext().getSelectedNav());
			
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
		}
		populateNavigation(form.getLocalContext().getSelectedNav());
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String checkExchequerCodeIsUnique(ValueObjectRef voRef, TaxonomyMapCollection collTaxMap)
{
	if(ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (voRef != null && collTaxMap != null)
		{
			for (int i = 0; i < collTaxMap.size(); i++)
			{
				if (collTaxMap.get(i) != null
					&& collTaxMap.get(i).getTaxonomyNameIsNotNull() 
					&& collTaxMap.get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					String dupExchequer = domain.checkExchequerCodeIsUnique(collTaxMap.get(i).getTaxonomyCode(), voRef);
					
					if(dupExchequer != null)
						return dupExchequer;
				}

			}
				
		}
	}
	return null;
	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForAssessment(ValueObjectRef refVo, AppFormVo assesmentForm)
{
	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(assesmentForm);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();

	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(refVo.getBoId());
	genVo.setClassName(refVo.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	newForm.setNodeText((refVo instanceof GraphicAssessmentShortVo) ? ((GraphicAssessmentShortVo) refVo).getName() : (refVo instanceof UserAssessmentLiteVo) ? ((UserAssessmentLiteVo) refVo).getName() : null);
	return newForm;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String checkExchequerCodeIsUnique(ValueObjectRef voRef, TaxonomyMapCollection collTaxMap)
{
	if(ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (voRef != null && collTaxMap != null)
		{
			for (int i = 0; i < collTaxMap.size(); i++)
			{
				if (collTaxMap.get(i) != null
					&& collTaxMap.get(i).getTaxonomyNameIsNotNull() 
					&& collTaxMap.get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					String dupExchequer = domain.checkExchequerCodeIsUnique(collTaxMap.get(i).getTaxonomyCode(), voRef);
					
					if(dupExchequer != null)
						return dupExchequer;
				}

			}
				
		}
	}
	return null;
	
	
}
 
Example 7
Project: AvoinApotti   File: OrganisationAndLocationImpl.java   Source Code and License 6 votes vote down vote up
public String checkExchequerCodeIsUnique(String taxonomyCode, ValueObjectRef refVo)
{		
	String dupMessage = "";
	
	dupMessage = checkExchequerCodeIsUniqueInOrganisation(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	dupMessage = checkExchequerCodeIsUniqueInLocSite(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	dupMessage = checkExchequerCodeIsUniqueInLocation(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	return null;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean verifyDateinRows(List<String> uiErrors, DynamicGridRowCollection rows, boolean foundBadExpiry)
{
	for (int i = 0; i < rows.size(); i++)
	{
		if (!(rows.get(i).getValue() != null && ((ValueObjectRef) rows.get(i).getValue()).getBoId() != null))
		{

			DynamicGridCell[] cellArray = rows.get(i).getCellArray();
			if (cellArray[2].getValue() != null && ((Date) cellArray[2].getValue()).isLessThan(new Date()))
			{
				uiErrors.add("Expiry Date can't be in the past");
				foundBadExpiry = true;
				break;
			}
		}
	}
	return foundBadExpiry;
}
 
Example 9
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForAssessment(ValueObjectRef refVo, AppFormVo assesmentForm)
{
	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(assesmentForm);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();

	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(refVo.getBoId());
	genVo.setClassName(refVo.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	newForm.setNodeText((refVo instanceof GraphicAssessmentShortVo) ? ((GraphicAssessmentShortVo) refVo).getName() : (refVo instanceof UserAssessmentLiteVo) ? ((UserAssessmentLiteVo) refVo).getName() : null);
	return newForm;
}
 
Example 10
Project: openMAXIMS   File: CcoContextEvalProvider.java   Source Code and License 6 votes vote down vote up
public ValueObjectRef getReferralCareContextForCareContext(ValueObjectRef refVo) {
	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, refVo.getBoId());
	if (ctx == null)
		throw new DomainRuntimeException("Invalid CareContext refVo passed into getReferralCareContextForCareContext. ");
	
	//get CareSpell
	String epidodeHQL ="select epis.id from CareContext as cc left join cc.episodeOfCare as epis where (cc.id = :careContextID) ";
	List<?> list = this.getDomainFactory().find(epidodeHQL,new String[]{"careContextID"},new Object[]{refVo.getBoId()});
	Integer episodeId = null;
	if(list!=null&&list.size()>0)
	{
		for (Object object : list)
		{
			episodeId= (Integer)object;
		}
		String referralCareContextHQL = "select cc from CareContext as cc left join cc.episodeOfCare as epis  where (cc.context.id = -3076 and epis.id = :episodeID)"; // -3076 == ContextType Referral
		CareContext referralCareContext = (CareContext)this.getDomainFactory().findFirst(referralCareContextHQL,new String[]{"episodeID"},new Object[]{episodeId});
		return CareContextShortVoAssembler.create(referralCareContext);
	}
	else 
	{
		return null;
	}
}
 
Example 11
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 6 votes vote down vote up
public ValueObjectRef getReferralCareContextForCareContext(ValueObjectRef refVo) {
	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, refVo.getBoId());
	if (ctx == null)
		throw new DomainRuntimeException("Invalid CareContext refVo passed into getReferralCareContextForCareContext. ");
	
	//get CareSpell
	String epidodeHQL ="select epis.id from CareContext as cc left join cc.episodeOfCare as epis where (cc.id = :careContextID) ";
	List<?> list = this.getDomainFactory().find(epidodeHQL,new String[]{"careContextID"},new Object[]{refVo.getBoId()});
	Integer episodeId = null;
	if(list!=null&&list.size()>0)
	{
		for (Object object : list)
		{
			episodeId= (Integer)object;
		}
		String referralCareContextHQL = "select cc from CareContext as cc left join cc.episodeOfCare as epis  where (cc.context.id = -3076 and epis.id = :episodeID)"; // -3076 == ContextType Referral
		CareContext referralCareContext = (CareContext)this.getDomainFactory().findFirst(referralCareContextHQL,new String[]{"episodeID"},new Object[]{episodeId});
		return CareContextShortVoAssembler.create(referralCareContext);
	}
	else 
	{
		return null;
	}
}
 
Example 12
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private String checkExchequerCodeIsUnique(ValueObjectRef voRef, TaxonomyMapCollection collTaxMap)
{
	if(ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (voRef != null && collTaxMap != null)
		{
			for (int i = 0; i < collTaxMap.size(); i++)
			{
				if (collTaxMap.get(i) != null
					&& collTaxMap.get(i).getTaxonomyNameIsNotNull() 
					&& collTaxMap.get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					String dupExchequer = domain.checkExchequerCodeIsUnique(collTaxMap.get(i).getTaxonomyCode(), voRef);
					
					if(dupExchequer != null)
						return dupExchequer;
				}

			}
				
		}
	}
	return null;
	
	
}
 
Example 13
Project: openmaxims-linux   File: OrganisationAndLocationImpl.java   Source Code and License 6 votes vote down vote up
public String checkExchequerCodeIsUnique(String taxonomyCode, ValueObjectRef refVo)
{		
	String dupMessage = "";
	
	dupMessage = checkExchequerCodeIsUniqueInOrganisation(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	dupMessage = checkExchequerCodeIsUniqueInLocSite(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	dupMessage = checkExchequerCodeIsUniqueInLocation(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	return null;
}
 
Example 14
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 6 votes vote down vote up
public String getLinkedReportName(ims.vo.ValueObjectRef refVo)
{
	if (refVo == null)
		return null;

	if(refVo instanceof UserAssessmentRefVo)
	{
		List<?> list = getDomainFactory().find("select u1_1.associatedReport.name from UserAssessment as u1_1 where (u1_1.id = :ID)", new String[] {"ID"}, new Object[] {new Integer(refVo.getBoId())});
		
		if(list != null && list.size() > 0)
		{
			return (String) list.get(0);
		}
		
		return null;			
	}
	else if(refVo instanceof GraphicAssessmentRefVo)
	{
		return null;
	}
	
	return null;
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdAssessmentsSelectionChanged() throws PresentationLogicException
{
	Object val;
	if (form.treNav().getSelectedNode() != null)
	{
		val = form.treNav().getSelectedNode().getValue();
		if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.grdAssessments().getValue();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.grdAssessments().getSelectedRow().getAssessmentName());
			populateNavigation(form.getLocalContext().getSelectedNav());
		}
	}
	form.grdAssessments().setEnabled(false);
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if(formName.equals(form.getForms().Core.ReportTemplate) && result.equals(DialogResult.OK))
	{
		Object val = form.treNav().getValue();
		
		AppNavFormVo navForm = addAppNavFormVo(getReportViewerForm(), val);
		if (navForm != null)
		{
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.getGlobalContext().Core.getReportTemplateRef();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
			populateNavigation(form.getLocalContext().getSelectedNav());
			
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
		}
		populateNavigation(form.getLocalContext().getSelectedNav());
	}
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String checkExchequerCodeIsUnique(ValueObjectRef voRef, TaxonomyMapCollection collTaxMap)
{
	if(ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (voRef != null && collTaxMap != null)
		{
			for (int i = 0; i < collTaxMap.size(); i++)
			{
				if (collTaxMap.get(i) != null
					&& collTaxMap.get(i).getTaxonomyNameIsNotNull() 
					&& collTaxMap.get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					String dupExchequer = domain.checkExchequerCodeIsUnique(collTaxMap.get(i).getTaxonomyCode(), voRef);
					
					if(dupExchequer != null)
						return dupExchequer;
				}

			}
				
		}
	}
	return null;
	
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavFormVo createFormForAssessment(ValueObjectRef refVo, AppFormVo assesmentForm)
{
	AppNavFormVo newForm = new AppNavFormVo();
	newForm.setForm(assesmentForm);
	GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();

	GenericIdentifierVo genVo = new GenericIdentifierVo();
	genVo.setInstanceId(refVo.getBoId());
	genVo.setClassName(refVo.getClass().getName());
	coll.add(genVo);
	newForm.setLinkedClasses(coll);

	newForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	newForm.setAccessForRip(FormReadWrite.WRITE);
	newForm.setIsReadOnly(false);
	newForm.setNodeText((refVo instanceof GraphicAssessmentShortVo) ? ((GraphicAssessmentShortVo) refVo).getName() : (refVo instanceof UserAssessmentLiteVo) ? ((UserAssessmentLiteVo) refVo).getName() : null);
	return newForm;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String checkExchequerCodeIsUnique(ValueObjectRef voRef, TaxonomyMapCollection collTaxMap)
{
	if(ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (voRef != null && collTaxMap != null)
		{
			for (int i = 0; i < collTaxMap.size(); i++)
			{
				if (collTaxMap.get(i) != null
					&& collTaxMap.get(i).getTaxonomyNameIsNotNull() 
					&& collTaxMap.get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					String dupExchequer = domain.checkExchequerCodeIsUnique(collTaxMap.get(i).getTaxonomyCode(), voRef);
					
					if(dupExchequer != null)
						return dupExchequer;
				}

			}
				
		}
	}
	return null;
	
	
}
 
Example 20
Project: openMAXIMS   File: OrganisationAndLocationImpl.java   Source Code and License 6 votes vote down vote up
public String checkExchequerCodeIsUnique(String taxonomyCode, ValueObjectRef refVo)
{		
	String dupMessage = "";
	
	dupMessage = checkExchequerCodeIsUniqueInOrganisation(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	dupMessage = checkExchequerCodeIsUniqueInLocSite(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	dupMessage = checkExchequerCodeIsUniqueInLocation(taxonomyCode, refVo);
	if (dupMessage != null)
	{
		return dupMessage;
	}
	
	return null;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean verifyDateinRows(List<String> uiErrors, DynamicGridRowCollection rows, boolean foundBadExpiry)
{
	for (int i = 0; i < rows.size(); i++)
	{
		if (!(rows.get(i).getValue() != null && ((ValueObjectRef) rows.get(i).getValue()).getBoId() != null))
		{

			DynamicGridCell[] cellArray = rows.get(i).getCellArray();
			if (cellArray[2].getValue() != null && ((Date) cellArray[2].getValue()).isLessThan(new Date()))
			{
				uiErrors.add("Expiry Date can't be in the past");
				foundBadExpiry = true;
				break;
			}
		}
	}
	return foundBadExpiry;
}
 
Example 22
Project: openmaxims-linux   File: DynamicAssessmentsImpl.java   Source Code and License 6 votes vote down vote up
public String getLinkedReportName(ims.vo.ValueObjectRef refVo)
{
	if (refVo == null)
		return null;

	if(refVo instanceof UserAssessmentRefVo)
	{
		List list = getDomainFactory().find("select u1_1.associatedReport.name from UserAssessment as u1_1 where (u1_1.id = :ID)", new String[] {"ID"}, new Object[] {new Integer(refVo.getBoId())});
		
		if(list != null && list.size() > 0)
		{
			return (String) list.get(0);
		}
		
		return null;			
	}
	else if(refVo instanceof GraphicAssessmentRefVo)
	{
		return null;
	}
	
	return null;
}
 
Example 23
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 6 votes vote down vote up
public String getLinkedReportName(ims.vo.ValueObjectRef refVo)
{
	if (refVo == null)
		return null;

	if(refVo instanceof UserAssessmentRefVo)
	{
		List list = getDomainFactory().find("select u1_1.associatedReport.name from UserAssessment as u1_1 where (u1_1.id = :ID)", new String[] {"ID"}, new Object[] {new Integer(refVo.getBoId())});
		
		if(list != null && list.size() > 0)
		{
			return (String) list.get(0);
		}
		
		return null;			
	}
	else if(refVo instanceof GraphicAssessmentRefVo)
	{
		return null;
	}
	
	return null;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String checkExchequerCodeIsUnique(ValueObjectRef voRef, TaxonomyMapCollection collTaxMap)
{
	if(ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (voRef != null && collTaxMap != null)
		{
			for (int i = 0; i < collTaxMap.size(); i++)
			{
				if (collTaxMap.get(i) != null
					&& collTaxMap.get(i).getTaxonomyNameIsNotNull() 
					&& collTaxMap.get(i).getTaxonomyName().equals(TaxonomyType.EXCH))
				{
					String dupExchequer = domain.checkExchequerCodeIsUnique(collTaxMap.get(i).getTaxonomyCode(), voRef);
					
					if(dupExchequer != null)
						return dupExchequer;
				}

			}
				
		}
	}
	return null;
	
}
 
Example 25
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdAssessmentsSelectionChanged() throws PresentationLogicException
{
	Object val;
	if (form.treNav().getSelectedNode() != null)
	{
		val = form.treNav().getSelectedNode().getValue();
		if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.grdAssessments().getValue();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.grdAssessments().getSelectedRow().getAssessmentName());
			populateNavigation(form.getLocalContext().getSelectedNav());
		}
	}
	form.grdAssessments().setEnabled(false);
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean verifyDateinRows(List<String> uiErrors, DynamicGridRowCollection rows, boolean foundBadExpiry)
{
	for (int i = 0; i < rows.size(); i++)
	{
		if (!(rows.get(i).getValue() != null && ((ValueObjectRef) rows.get(i).getValue()).getBoId() != null))
		{

			DynamicGridCell[] cellArray = rows.get(i).getCellArray();
			if (cellArray[2].getValue() != null && ((Date) cellArray[2].getValue()).isLessThan(new Date()))
			{
				uiErrors.add("Expiry Date can't be in the past");
				foundBadExpiry = true;
				break;
			}
		}
	}
	return foundBadExpiry;
}
 
Example 27
Project: AvoinApotti   File: BaseContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void recordReadAudit(ValueObjectRef refVo, String action)
{
	if (ConfigFlag.DOM.READ_AUDIT_ENABLED.getValue() != true)
		return;
	
	ReadAudit domRead = new ReadAudit();
	domRead.setPatientId(refVo.getBoId());
	domRead.setAuditAction(action);
	domRead.setAuditDateTime(new java.util.Date());
		
	IAppUser user = getSession().getUser();
	if (user != null)
	{
		domRead.setAuditUser(user.getUsername());
		domRead.setAuditHost(user.getHostName());
	}
	ILocation loc = getCurrentLocation();
	if (loc != null)
		domRead.setAuditUserLocation(new Integer(loc.getID()));
	try
	{
		getDomainFactory().save(domRead);
	}
	catch (StaleObjectException e)
	{
		throw new DomainRuntimeException("StaleObjectException occurred saving ReadAudit record");
	}
}
 
Example 28
Project: AvoinApotti   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getPatientForEpisodeOfCare(ValueObjectRef refVo)
{
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, refVo.getBoId());
	if (epis == null)
		throw new DomainRuntimeException("Invalid EpisodeOfCare refVo passed into getPatientForEpisodeOfCare. ");
	
	PatientRefVo patRef = new PatientRefVo(epis.getCareSpell().getPatient().getId(), epis.getCareSpell().getPatient().getVersion());
	Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
	return demog.getPatient(patRef);			
}
 
Example 29
Project: AvoinApotti   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getCareContextForClinicalContact(ValueObjectRef refVo)
{
	ClinicalContact con = (ClinicalContact)this.getDomainFactory().getDomainObject(ClinicalContact.class, refVo.getBoId());
	if (con == null)
		throw new DomainRuntimeException("Invalid ClinicalContact refVo passed into getCareContextForClinicalContact. ");

	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, con.getCareContext().getId());
	if (ctx == null)
		throw new DomainRuntimeException("CareContext not found for ClinicalContact passed into getCareContextForClinicalContact");
	
	return CareContextShortVoAssembler.create(ctx);	
}
 
Example 30
Project: AvoinApotti   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getEpisodeOfCareForCareContext(ValueObjectRef refVo)
{
	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, refVo.getBoId());
	if (ctx == null)
		throw new DomainRuntimeException("Invalid CareContext refVo passed into getEpisodeOfCareForCareContext. ");
	
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, ctx.getEpisodeOfCare().getId());
	if (epis == null)
		throw new DomainRuntimeException("EpisodeOfCare not found for  CareContext passed into getEpisodeOfCareForCareContext");

	return EpisodeofCareShortVoAssembler.create(epis);	
}
 
Example 31
Project: AvoinApotti   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 32
Project: AvoinApotti   File: CcoBaseContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void recordReadAudit(ValueObjectRef refVo, String action)
{
	if (ConfigFlag.DOM.READ_AUDIT_ENABLED.getValue() != true)
		return;
	
	ReadAudit domRead = new ReadAudit();
	domRead.setPatientId(refVo.getBoId());
	domRead.setAuditAction(action);
	domRead.setAuditDateTime(new java.util.Date());
		
	IAppUser user = getSession().getUser();
	if (user != null)
	{
		domRead.setAuditUser(user.getUsername());
		domRead.setAuditHost(user.getHostName());
	}
	ILocation loc = getCurrentLocation();
	if (loc != null)
		domRead.setAuditUserLocation(new Integer(loc.getID()));
	try
	{
		getDomainFactory().save(domRead);
	}
	catch (StaleObjectException e)
	{
		throw new DomainRuntimeException("StaleObjectException occurred saving ReadAudit record");
	}
}
 
Example 33
Project: AvoinApotti   File: OcrrContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	if (form.getGlobalContext().Oncology.getSelectedRecordForOverallDialogIsNotNull())
	{
		ValueObjectRef voSiteRef  = form.getGlobalContext().Oncology.getSelectedRecordForOverallDialog().getSelectedSiteRecord();
		ValueObjectRef voGroupRef = form.getGlobalContext().Oncology.getSelectedRecordForOverallDialog().getSelectedGroupRecord();
		TumourGroupSiteForOverallStagingDialogVo voGroup = domain.getGroupForOverallStaging((TumourGroupRefVo)voGroupRef);
		
		// WDEV-13091
		// This check theoretically should not fail, but
		if (voGroup == null)
			throw new PresentationLogicException("Minimal context for form is not met");
		
		form.getLocalContext().setSelectedGroup(null);
		if (voGroup != null)
			form.getLocalContext().setSelectedGroup(voGroup);
		
		//if dialog is open from Group
		if (voSiteRef == null)
		{
			populateComboBoxes(voGroup, null, voGroup.getTNMValues());
		}
		//if dialog is open from Site
		else
		{
			TumourGroupSiteTNMValueListVoCollection voCollTNM = domain.getTNMValueForSite((TumourSiteRefVo)voSiteRef);
			
			TumourSiteVo voSite = domain.getSiteVo((TumourSiteRefVo)voSiteRef);
			form.getLocalContext().setSelectedSite(null);
			if (voSite != null)
				form.getLocalContext().setSelectedSite(voSite);
			
			populateComboBoxes(voGroup, voSite, voCollTNM);
		}
	} 
}
 
Example 35
Project: AvoinApotti   File: TumourCategoryGroupSitesImpl.java   Source Code and License 5 votes vote down vote up
public Integer countForOverallStaging(ValueObjectRef voRef)
{
	if (voRef == null)
		throw new DomainRuntimeException("Invalid Value Object");

	String hql = "";
	String[] strings = new String[]{"id"};
	Object[] objects = null;

	Long start = System.currentTimeMillis();

	if (voRef instanceof TumourGroupRefVo)
	{
		hql = "select count(t1_1.id) from TumourGroupSiteOverallStaging as t1_1 join t1_1.tGroup as t2_1 where t2_1.id = :id ";
		objects = new Object[]{((TumourGroupRefVo) voRef).getID_TumourGroup()};
	}
	else if (voRef instanceof TumourSiteRefVo)
	{
		hql = "select count(t1_1.id) from TumourGroupSiteOverallStaging as t1_1 join t1_1.tSite as t2_1 where t2_1.id = :id ";
		objects = new Object[]{((TumourSiteRefVo) voRef).getID_TumourSite()};
	}

	Long end = System.currentTimeMillis();
	Long result = end - start;
	System.out.println(result);

	List find = getDomainFactory().find(hql, strings, objects);

	if (find.size() == 0)
		return 0;

	return ((Long) find.get(0)).intValue();
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void getPreviousLastAssessment() 
{
	if(isStructuralAssessment())
	{
		if(form.getLocalContext().getStructuralAssessment() != null && form.getLocalContext().getStructuralAssessment().getCanCopyLastIsNotNull() && form.getLocalContext().getStructuralAssessment().getCanCopyLast() && form.getLocalContext().getStructuralAssessment().getCopyLastFromContextIsNotNull())
		{
			//WDEV-11721
			ValueObjectRef contextType = getContextTypeUsedForCopyLast();	
			form.getLocalContext().setCopyAnswersFromPreviousAssessment(domain.getPreviousPatientAssessment(contextType, form.getLocalContext().getStructuralAssessmentRef()));
		}
	}
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private ValueObjectRef getContextTypeUsedForCopyLast()
{
	ValueObjectRef contextType = null;
	
	if(CopyLastAssessmentContextType.PATIENT.equals(form.getLocalContext().getStructuralAssessment().getCopyLastFromContext()))
	{
		contextType = form.getGlobalContext().Core.getPatientShort();
	}
	else if(CopyLastAssessmentContextType.CARE_SPELL.equals(form.getLocalContext().getStructuralAssessment().getCopyLastFromContext()))
	{
		//WDEV-11526
   		contextType = form.getGlobalContext().Core.getEpisodeofCareShort() != null ? form.getGlobalContext().Core.getEpisodeofCareShort().getCareSpell() : form.getGlobalContext().Core.getPatientShort();
	}
	else if(CopyLastAssessmentContextType.EPISODEOFCARE.equals(form.getLocalContext().getStructuralAssessment().getCopyLastFromContext()))
	{
		//WDEV-11526
		contextType = form.getGlobalContext().Core.getEpisodeofCareShort() != null ? form.getGlobalContext().Core.getEpisodeofCareShort() : form.getGlobalContext().Core.getPatientShort();
	}
	else if(CopyLastAssessmentContextType.CARECONTEXT.equals(form.getLocalContext().getStructuralAssessment().getCopyLastFromContext()))
	{
		//WDEV-11526 - starts here
		if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
			contextType = form.getGlobalContext().Core.getCurrentCareContext();
		else
			contextType = form.getGlobalContext().Core.getEpisodeofCareShort() != null ? form.getGlobalContext().Core.getEpisodeofCareShort() : form.getGlobalContext().Core.getPatientShort();
		//WDEV-11526 - ends here
	}
	
	return contextType;
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getNavFormTooltip(AppNavFormVo af)
{
	StringBuffer sb = new StringBuffer();
	
	if(af.getAppForm().isAlias())
	{
		sb.append("<b>Form : </b>"+af.getForm().getName()+" ("+af.getAppForm().getAliasName()+")");
	}
	else
	{
		sb.append("<b>Form : </b>" + af.getForm().getName());
	}
	sb.append("<br><b>RIP : </b>" + af.getFormAccessForRip().toString());
	sb.append("<br><b>EPIS : </b>" + af.getFormAccessForEpisEnd().toString());
	if (af.getLinkedClasses() != null && af.getLinkedClasses().size() > 0)
	{
		GenericIdentifierVo genId = af.getLinkedClasses().get(0);
		ValueObjectRef voRef = (ValueObjectRef)GenericIdentifierFactory.instantiate(genId);
		ValueObject assess = domain.getAssessment(voRef);
		if (assess instanceof UserAssessmentLiteVo)
		{
			genId.setClassType(STRUCTURED_ASSESSMENT);
			UserAssessmentLiteVo userAssess = (UserAssessmentLiteVo)assess;
			sb.append("<br><b>Structured Assessment : </b>" + userAssess.getName());				
		}
		else if (assess instanceof GraphicAssessmentShortVo)
		{
			genId.setClassType(GRAPHIC_ASSESSMENT);
			GraphicAssessmentShortVo graphicAssess = (GraphicAssessmentShortVo)assess;
			sb.append("<br><b>Graphic Assessment : </b>" + graphicAssess.getName());
		}
	}		
	return sb.toString();
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onGrdNavAssesmentsGridCheckBoxClicked(int column, grdNavAssesmentsRow row, boolean isChecked) throws PresentationLogicException
{
	row.setBackColor(isChecked ? Color.Beige : Color.White);
	ArrayList<ValueObjectRef> selAssesments = form.getLocalContext().getSelectedAssesments();
	if (isChecked)
	{
		if (selAssesments == null)
		{
			selAssesments = new ArrayList<ValueObjectRef>();
		}

		selAssesments.add(row.getValue());

	}
	else
	{
		if (selAssesments == null)
		{
			// error
			return;
		}
		selAssesments.remove(row.getValue());
	}
	form.getLocalContext().setSelectedAssesments(selAssesments);
	updateControlsState();
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private ArrayList getArrayList(Object obj)
{
	ArrayList<ValueObjectRef> list = new ArrayList<ValueObjectRef>();
		
	if (obj instanceof PatientICPMediumVoCollection) 
	{
		PatientICPMediumVoCollection coll = (PatientICPMediumVoCollection)obj;
		for (int i = 0; i < coll.size(); i++)
		{
			list.add(coll.get(i));
		}	
	}
	return list;
}
 
Example 41
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private ArrayList getArrayList(Object obj)
{
	ArrayList<ValueObjectRef> list = new ArrayList<ValueObjectRef>();
		
	if (obj instanceof PatientICPMediumVoCollection) 
	{
		PatientICPMediumVoCollection coll = (PatientICPMediumVoCollection)obj;
		for (int i = 0; i < coll.size(); i++)
		{
			list.add(coll.get(i));
		}	
	}
	return list;
}
 
Example 42
Project: openMAXIMS   File: BaseContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void recordReadAudit(ValueObjectRef refVo, String action)
{
	if (ConfigFlag.DOM.READ_AUDIT_ENABLED.getValue() != true)
		return;
	
	ReadAudit domRead = new ReadAudit();
	domRead.setPatientId(refVo.getBoId());
	domRead.setAuditAction(action);
	domRead.setAuditDateTime(new java.util.Date());
		
	IAppUser user = getSession().getUser();
	if (user != null)
	{
		domRead.setAuditUser(user.getUsername());
		domRead.setAuditHost(user.getHostName());
	}
	ILocation loc = getCurrentLocation();
	if (loc != null)
		domRead.setAuditUserLocation(new Integer(loc.getID()));
	try
	{
		getDomainFactory().save(domRead);
	}
	catch (StaleObjectException e)
	{
		throw new DomainRuntimeException("StaleObjectException occurred saving ReadAudit record");
	}
}
 
Example 43
Project: openmaxims-linux   File: TumourCategoryGroupSitesImpl.java   Source Code and License 5 votes vote down vote up
public Integer countForOverallStaging(ValueObjectRef voRef)
{
	if (voRef == null)
		throw new DomainRuntimeException("Invalid Value Object");

	String hql = "";
	String[] strings = new String[]{"id"};
	Object[] objects = null;

	Long start = System.currentTimeMillis();

	if (voRef instanceof TumourGroupRefVo)
	{
		hql = "select count(t1_1.id) from TumourGroupSiteOverallStaging as t1_1 join t1_1.tGroup as t2_1 where t2_1.id = :id ";
		objects = new Object[]{((TumourGroupRefVo) voRef).getID_TumourGroup()};
	}
	else if (voRef instanceof TumourSiteRefVo)
	{
		hql = "select count(t1_1.id) from TumourGroupSiteOverallStaging as t1_1 join t1_1.tSite as t2_1 where t2_1.id = :id ";
		objects = new Object[]{((TumourSiteRefVo) voRef).getID_TumourSite()};
	}

	Long end = System.currentTimeMillis();
	Long result = end - start;
	System.out.println(result);

	List find = getDomainFactory().find(hql, strings, objects);

	if (find.size() == 0)
		return 0;

	return ((Long) find.get(0)).intValue();
}
 
Example 44
Project: openMAXIMS   File: CcoContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getCareContextForClinicalContact(ValueObjectRef refVo)
{
	ClinicalContact con = (ClinicalContact)this.getDomainFactory().getDomainObject(ClinicalContact.class, refVo.getBoId());
	if (con == null)
		throw new DomainRuntimeException("Invalid ClinicalContact refVo passed into getCareContextForClinicalContact. ");

	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, con.getCareContext().getId());
	if (ctx == null)
		throw new DomainRuntimeException("CareContext not found for ClinicalContact passed into getCareContextForClinicalContact");
	
	return CareContextShortVoAssembler.create(ctx);	
}
 
Example 45
Project: openMAXIMS   File: CcoContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getEpisodeOfCareForCareContext(ValueObjectRef refVo)
{
	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, refVo.getBoId());
	if (ctx == null)
		throw new DomainRuntimeException("Invalid CareContext refVo passed into getEpisodeOfCareForCareContext. ");
	
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, ctx.getEpisodeOfCare().getId());
	if (epis == null)
		throw new DomainRuntimeException("EpisodeOfCare not found for  CareContext passed into getEpisodeOfCareForCareContext");

	return EpisodeofCareShortVoAssembler.create(epis);	
}
 
Example 46
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getPatientForEpisodeOfCare(ValueObjectRef refVo)
{
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, refVo.getBoId());
	if (epis == null)
		throw new DomainRuntimeException("Invalid EpisodeOfCare refVo passed into getPatientForEpisodeOfCare. ");
	
	PatientRefVo patRef = new PatientRefVo(epis.getCareSpell().getPatient().getId(), epis.getCareSpell().getPatient().getVersion());
	Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
	return demog.getPatient(patRef);			
}
 
Example 47
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onGrdNavAssesmentsGridCheckBoxClicked(int column, grdNavAssesmentsRow row, boolean isChecked) throws PresentationLogicException
{
	row.setBackColor(isChecked ? Color.Beige : Color.White);
	ArrayList<ValueObjectRef> selAssesments = form.getLocalContext().getSelectedAssesments();
	if (isChecked)
	{
		if (selAssesments == null)
		{
			selAssesments = new ArrayList<ValueObjectRef>();
		}

		selAssesments.add(row.getValue());

	}
	else
	{
		if (selAssesments == null)
		{
			// error
			return;
		}
		selAssesments.remove(row.getValue());
	}
	form.getLocalContext().setSelectedAssesments(selAssesments);
	updateControlsState();
}
 
Example 48
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getEpisodeOfCareForCareContext(ValueObjectRef refVo)
{
	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, refVo.getBoId());
	if (ctx == null)
		throw new DomainRuntimeException("Invalid CareContext refVo passed into getEpisodeOfCareForCareContext. ");
	
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, ctx.getEpisodeOfCare().getId());
	if (epis == null)
		throw new DomainRuntimeException("EpisodeOfCare not found for  CareContext passed into getEpisodeOfCareForCareContext");

	return EpisodeofCareShortVoAssembler.create(epis);	
}
 
Example 49
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	if (form.getGlobalContext().Oncology.getSelectedRecordForOverallDialogIsNotNull())
	{
		ValueObjectRef voSiteRef  = form.getGlobalContext().Oncology.getSelectedRecordForOverallDialog().getSelectedSiteRecord();
		ValueObjectRef voGroupRef = form.getGlobalContext().Oncology.getSelectedRecordForOverallDialog().getSelectedGroupRecord();
		TumourGroupSiteForOverallStagingDialogVo voGroup = domain.getGroupForOverallStaging((TumourGroupRefVo)voGroupRef);
		
		// WDEV-13091
		// This check theoretically should not fail, but
		if (voGroup == null)
			throw new PresentationLogicException("Minimal context for form is not met");
		
		form.getLocalContext().setSelectedGroup(null);
		if (voGroup != null)
			form.getLocalContext().setSelectedGroup(voGroup);
		
		//if dialog is open from Group
		if (voSiteRef == null)
		{
			populateComboBoxes(voGroup, null, voGroup.getTNMValues());
		}
		//if dialog is open from Site
		else
		{
			TumourGroupSiteTNMValueListVoCollection voCollTNM = domain.getTNMValueForSite((TumourSiteRefVo)voSiteRef);
			
			TumourSiteVo voSite = domain.getSiteVo((TumourSiteRefVo)voSiteRef);
			form.getLocalContext().setSelectedSite(null);
			if (voSite != null)
				form.getLocalContext().setSelectedSite(voSite);
			
			populateComboBoxes(voGroup, voSite, voCollTNM);
		}
	} 
}
 
Example 50
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void getPreviousLastAssessment() 
{
	if(isStructuralAssessment())
	{
		if(form.getLocalContext().getStructuralAssessment() != null && form.getLocalContext().getStructuralAssessment().getCanCopyLastIsNotNull() && form.getLocalContext().getStructuralAssessment().getCanCopyLast() && form.getLocalContext().getStructuralAssessment().getCopyLastFromContextIsNotNull())
		{
			//WDEV-11721
			ValueObjectRef contextType = getContextTypeUsedForCopyLast();	
			form.getLocalContext().setCopyAnswersFromPreviousAssessment(domain.getPreviousPatientAssessment(contextType, form.getLocalContext().getStructuralAssessmentRef()));
		}
	}
}
 
Example 51
Project: openmaxims-linux   File: OcrrContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void getPreviousLastAssessment() 
{
	if(isStructuralAssessment())
	{
		if(form.getLocalContext().getStructuralAssessment() != null && form.getLocalContext().getStructuralAssessment().getCanCopyLastIsNotNull() && form.getLocalContext().getStructuralAssessment().getCanCopyLast() && form.getLocalContext().getStructuralAssessment().getCopyLastFromContextIsNotNull())
		{
			//WDEV-11721
			ValueObjectRef contextType = getContextTypeUsedForCopyLast();	
			form.getLocalContext().setCopyAnswersFromPreviousAssessment(domain.getPreviousPatientAssessment(contextType, form.getLocalContext().getStructuralAssessmentRef()));
		}
	}
}
 
Example 53
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private ValueObjectRef getContextTypeUsedForCopyLast()
{
	ValueObjectRef contextType = null;
	
	if(CopyLastAssessmentContextType.PATIENT.equals(form.getLocalContext().getStructuralAssessment().getCopyLastFromContext()))
	{
		contextType = form.getGlobalContext().Core.getPatientShort();
	}
	else if(CopyLastAssessmentContextType.CARE_SPELL.equals(form.getLocalContext().getStructuralAssessment().getCopyLastFromContext()))
	{
		//WDEV-11526
   		contextType = form.getGlobalContext().Core.getEpisodeofCareShort() != null ? form.getGlobalContext().Core.getEpisodeofCareShort().getCareSpell() : form.getGlobalContext().Core.getPatientShort();
	}
	else if(CopyLastAssessmentContextType.EPISODEOFCARE.equals(form.getLocalContext().getStructuralAssessment().getCopyLastFromContext()))
	{
		//WDEV-11526
		contextType = form.getGlobalContext().Core.getEpisodeofCareShort() != null ? form.getGlobalContext().Core.getEpisodeofCareShort() : form.getGlobalContext().Core.getPatientShort();
	}
	else if(CopyLastAssessmentContextType.CARECONTEXT.equals(form.getLocalContext().getStructuralAssessment().getCopyLastFromContext()))
	{
		//WDEV-11526 - starts here
		if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
			contextType = form.getGlobalContext().Core.getCurrentCareContext();
		else
			contextType = form.getGlobalContext().Core.getEpisodeofCareShort() != null ? form.getGlobalContext().Core.getEpisodeofCareShort() : form.getGlobalContext().Core.getPatientShort();
		//WDEV-11526 - ends here
	}
	
	return contextType;
}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onGrdNavAssesmentsGridCheckBoxClicked(int column, grdNavAssesmentsRow row, boolean isChecked) throws PresentationLogicException
{
	row.setBackColor(isChecked ? Color.Beige : Color.White);
	ArrayList<ValueObjectRef> selAssesments = form.getLocalContext().getSelectedAssesments();
	if (isChecked)
	{
		if (selAssesments == null)
		{
			selAssesments = new ArrayList<ValueObjectRef>();
		}

		selAssesments.add(row.getValue());

	}
	else
	{
		if (selAssesments == null)
		{
			// error
			return;
		}
		selAssesments.remove(row.getValue());
	}
	form.getLocalContext().setSelectedAssesments(selAssesments);
	//updateControlsState(); //wdev-19656
	//wdev-19656
	addAssesmentsToTree();
	updateControlsState();
	//----------
	
}
 
Example 55
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private ArrayList getArrayList(Object obj)
{
	ArrayList<ValueObjectRef> list = new ArrayList<ValueObjectRef>();
		
	if (obj instanceof PatientICPMediumVoCollection) 
	{
		PatientICPMediumVoCollection coll = (PatientICPMediumVoCollection)obj;
		for (int i = 0; i < coll.size(); i++)
		{
			list.add(coll.get(i));
		}	
	}
	return list;
}
 
Example 56
Project: openMAXIMS   File: BaseContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void recordReadAudit(ValueObjectRef refVo, String action)
{
	if (ConfigFlag.DOM.READ_AUDIT_ENABLED.getValue() != true)
		return;
	
	ReadAudit domRead = new ReadAudit();
	domRead.setPatientId(refVo.getBoId());
	domRead.setAuditAction(action);
	domRead.setAuditDateTime(new java.util.Date());
		
	IAppUser user = getSession().getUser();
	if (user != null)
	{
		domRead.setAuditUser(user.getUsername());
		domRead.setAuditHost(user.getHostName());
	}
	ILocation loc = getCurrentLocation();
	if (loc != null)
		domRead.setAuditUserLocation(new Integer(loc.getID()));
	try
	{
		getDomainFactory().save(domRead);
	}
	catch (StaleObjectException e)
	{
		throw new DomainRuntimeException("StaleObjectException occurred saving ReadAudit record");
	}
}
 
Example 57
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getPatientForEpisodeOfCare(ValueObjectRef refVo)
{
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, refVo.getBoId());
	if (epis == null)
		throw new DomainRuntimeException("Invalid EpisodeOfCare refVo passed into getPatientForEpisodeOfCare. ");
	
	PatientRefVo patRef = new PatientRefVo(epis.getCareSpell().getPatient().getId(), epis.getCareSpell().getPatient().getVersion());
	Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
	return demog.getPatient(patRef);			
}
 
Example 58
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getCareContextForClinicalContact(ValueObjectRef refVo)
{
	ClinicalContact con = (ClinicalContact)this.getDomainFactory().getDomainObject(ClinicalContact.class, refVo.getBoId());
	if (con == null)
		throw new DomainRuntimeException("Invalid ClinicalContact refVo passed into getCareContextForClinicalContact. ");

	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, con.getCareContext().getId());
	if (ctx == null)
		throw new DomainRuntimeException("CareContext not found for ClinicalContact passed into getCareContextForClinicalContact");
	
	return CareContextShortVoAssembler.create(ctx);	
}
 
Example 59
Project: openmaxims-linux   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getEpisodeOfCareForCareContext(ValueObjectRef refVo)
{
	CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, refVo.getBoId());
	if (ctx == null)
		throw new DomainRuntimeException("Invalid CareContext refVo passed into getEpisodeOfCareForCareContext. ");
	
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, ctx.getEpisodeOfCare().getId());
	if (epis == null)
		throw new DomainRuntimeException("EpisodeOfCare not found for  CareContext passed into getEpisodeOfCareForCareContext");

	return EpisodeofCareShortVoAssembler.create(epis);	
}
 
Example 60
Project: openmaxims-linux   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getPatientForEpisodeOfCare(ValueObjectRef refVo)
{
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, refVo.getBoId());
	if (epis == null)
		throw new DomainRuntimeException("Invalid EpisodeOfCare refVo passed into getPatientForEpisodeOfCare. ");
	
	PatientRefVo patRef = new PatientRefVo(epis.getCareSpell().getPatient().getId(), epis.getCareSpell().getPatient().getVersion());
	Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
	return demog.getPatient(patRef);			
}