Java Code Examples for ims.assessment.configuration.vo.UserAssessmentRefVo

The following are top voted examples for showing how to use ims.assessment.configuration.vo.UserAssessmentRefVo. 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: AssessmentAsReportImpl.java   Source Code and License 6 votes vote down vote up
/**
* getReportAndTemplate
*/
public String[] getReportAndTemplate(ims.vo.ValueObjectRef refVo)
{
	String[] result = null;
	
	if(refVo == null)
		return null;
	
	if(refVo instanceof UserAssessmentRefVo)
	{
			List list = getDomainFactory().find("select r1_1.reportXml, t1_1.templateXml \r\n" + 
					"from UserAssessment as u1_1 left join u1_1.associatedReport as t1_1 left join t1_1.report as r1_1\r\n" + 
					"where (u1_1.id = :ID) ", new String[] {"ID"}, new Object[] {refVo.getBoId()});

			if(list.iterator().hasNext())
			{
				Object[] obj = (Object[])list.iterator().next();
				
				result = new String[] {(String)obj[0], (String)obj[1]};
			}
	}
	
	return result;		
}
 
Example 2
Project: AvoinApotti   File: ManchesterTreatmentProtocolAdminImpl.java   Source Code and License 6 votes vote down vote up
public Boolean checkForConfiguredAssessment(UserAssessmentRefVo userAssessmentShortVoRef) 
{
	if (userAssessmentShortVoRef == null)
		return false;

	DomainFactory factory = getDomainFactory();
	String hql = " from ProblemTriageProtocol ptp " +
	" where ptp.triageProtocol.id = :tp "; 

	List tpList = factory.find(hql,new String[]{"tp"}, new Object[]{userAssessmentShortVoRef.getID_UserAssessment()});

	if (tpList != null && tpList.size() > 0)
		return true;

	return false;
}
 
Example 3
Project: AvoinApotti   File: AssessmentConfig.java   Source Code and License 6 votes vote down vote up
/**
 * @param voPatientUserDefinedObject
 * @param userAssessmentRefVo
 * @param graphicAssessmentRefVo
 * @return
 */
private UserDefinedObjectComponentVo getUserDefinedObjectComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, UserAssessmentRefVo userAssessmentRefVo, GraphicAssessmentRefVo graphicAssessmentRefVo)
{
	if (userAssessmentRefVo == null && graphicAssessmentRefVo == null)
		return null;

	if (voPatientUserDefinedObject != null && voPatientUserDefinedObject.getUserDefinedObjectIsNotNull())
	{
		for (int i = 0; i < voPatientUserDefinedObject.getUserDefinedObject().getComponents().size(); i++)
		{
			UserDefinedObjectComponentVo voUserDefinedObjectComponent = voPatientUserDefinedObject.getUserDefinedObject().getComponents().get(i);
			UserAssessmentRefVo userUserDefinedAssessmentRefVo = voUserDefinedObjectComponent.getUserAssessment();
			GraphicAssessmentRefVo graphicUserDefinedAssessmentRefVo = voUserDefinedObjectComponent.getGraphic();
			boolean sameUserAssessment = userUserDefinedAssessmentRefVo != null && userUserDefinedAssessmentRefVo.equals(userAssessmentRefVo);
			boolean sameGraphicAssessment = graphicUserDefinedAssessmentRefVo != null && graphicUserDefinedAssessmentRefVo.equals(graphicAssessmentRefVo);

			if (sameUserAssessment || sameGraphicAssessment)
				return voUserDefinedObjectComponent;
		}
	}

	return null;
}
 
Example 4
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 5
Project: openMAXIMS   File: AssessmentAsReportImpl.java   Source Code and License 6 votes vote down vote up
/**
* getReportAndTemplate
*/
public String[] getReportAndTemplate(ims.vo.ValueObjectRef refVo)
{
	String[] result = null;
	
	if(refVo == null)
		return null;
	
	if(refVo instanceof UserAssessmentRefVo)
	{
			List list = getDomainFactory().find("select r1_1.reportXml, t1_1.templateXml \r\n" + 
					"from UserAssessment as u1_1 left join u1_1.associatedReport as t1_1 left join t1_1.report as r1_1\r\n" + 
					"where (u1_1.id = :ID) ", new String[] {"ID"}, new Object[] {refVo.getBoId()});

			if(list.iterator().hasNext())
			{
				Object[] obj = (Object[])list.iterator().next();
				
				result = new String[] {(String)obj[0], (String)obj[1]};
			}
	}
	
	return result;		
}
 
Example 6
Project: openMAXIMS   File: AssessmentConfig.java   Source Code and License 6 votes vote down vote up
/**
 * @param voPatientUserDefinedObject
 * @param userAssessmentRefVo
 * @param graphicAssessmentRefVo
 * @return
 */
private UserDefinedObjectComponentVo getUserDefinedObjectComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, UserAssessmentRefVo userAssessmentRefVo, GraphicAssessmentRefVo graphicAssessmentRefVo)
{
	if (userAssessmentRefVo == null && graphicAssessmentRefVo == null)
		return null;

	if (voPatientUserDefinedObject != null && voPatientUserDefinedObject.getUserDefinedObjectIsNotNull())
	{
		for (int i = 0; i < voPatientUserDefinedObject.getUserDefinedObject().getComponents().size(); i++)
		{
			UserDefinedObjectComponentVo voUserDefinedObjectComponent = voPatientUserDefinedObject.getUserDefinedObject().getComponents().get(i);
			UserAssessmentRefVo userUserDefinedAssessmentRefVo = voUserDefinedObjectComponent.getUserAssessment();
			GraphicAssessmentRefVo graphicUserDefinedAssessmentRefVo = voUserDefinedObjectComponent.getGraphic();
			boolean sameUserAssessment = userUserDefinedAssessmentRefVo != null && userUserDefinedAssessmentRefVo.equals(userAssessmentRefVo);
			boolean sameGraphicAssessment = graphicUserDefinedAssessmentRefVo != null && graphicUserDefinedAssessmentRefVo.equals(graphicAssessmentRefVo);

			if (sameUserAssessment || sameGraphicAssessment)
				return voUserDefinedObjectComponent;
		}
	}

	return null;
}
 
Example 7
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 8
Project: openMAXIMS   File: AssessmentAsReportImpl.java   Source Code and License 6 votes vote down vote up
/**
* getReportAndTemplate
*/
public String[] getReportAndTemplate(ims.vo.ValueObjectRef refVo)
{
	String[] result = null;
	
	if(refVo == null)
		return null;
	
	if(refVo instanceof UserAssessmentRefVo)
	{
			List list = getDomainFactory().find("select r1_1.reportXml, t1_1.templateXml \r\n" + 
					"from UserAssessment as u1_1 left join u1_1.associatedReport as t1_1 left join t1_1.report as r1_1\r\n" + 
					"where (u1_1.id = :ID) ", new String[] {"ID"}, new Object[] {refVo.getBoId()});

			if(list.iterator().hasNext())
			{
				Object[] obj = (Object[])list.iterator().next();
				
				result = new String[] {(String)obj[0], (String)obj[1]};
			}
	}
	
	return result;		
}
 
Example 9
Project: openMAXIMS   File: ManchesterTreatmentProtocolAdminImpl.java   Source Code and License 6 votes vote down vote up
public Boolean checkForConfiguredAssessment(UserAssessmentRefVo userAssessmentShortVoRef) 
{
	if (userAssessmentShortVoRef == null)
		return false;

	DomainFactory factory = getDomainFactory();
	String hql = " from ProblemTriageProtocol ptp " +
	" where ptp.triageProtocol.id = :tp "; 

	List tpList = factory.find(hql,new String[]{"tp"}, new Object[]{userAssessmentShortVoRef.getID_UserAssessment()});

	if (tpList != null && tpList.size() > 0)
		return true;

	return false;
}
 
Example 10
Project: openMAXIMS   File: AssessmentConfig.java   Source Code and License 6 votes vote down vote up
/**
 * @param voPatientUserDefinedObject
 * @param userAssessmentRefVo
 * @param graphicAssessmentRefVo
 * @return
 */
private UserDefinedObjectComponentVo getUserDefinedObjectComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, UserAssessmentRefVo userAssessmentRefVo, GraphicAssessmentRefVo graphicAssessmentRefVo)
{
	if (userAssessmentRefVo == null && graphicAssessmentRefVo == null)
		return null;

	if (voPatientUserDefinedObject != null && voPatientUserDefinedObject.getUserDefinedObjectIsNotNull())
	{
		for (int i = 0; i < voPatientUserDefinedObject.getUserDefinedObject().getComponents().size(); i++)
		{
			UserDefinedObjectComponentVo voUserDefinedObjectComponent = voPatientUserDefinedObject.getUserDefinedObject().getComponents().get(i);
			UserAssessmentRefVo userUserDefinedAssessmentRefVo = voUserDefinedObjectComponent.getUserAssessment();
			GraphicAssessmentRefVo graphicUserDefinedAssessmentRefVo = voUserDefinedObjectComponent.getGraphic();
			boolean sameUserAssessment = userUserDefinedAssessmentRefVo != null && userUserDefinedAssessmentRefVo.equals(userAssessmentRefVo);
			boolean sameGraphicAssessment = graphicUserDefinedAssessmentRefVo != null && graphicUserDefinedAssessmentRefVo.equals(graphicAssessmentRefVo);

			if (sameUserAssessment || sameGraphicAssessment)
				return voUserDefinedObjectComponent;
		}
	}

	return null;
}
 
Example 11
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 12
Project: openmaxims-linux   File: AssessmentAsReportImpl.java   Source Code and License 6 votes vote down vote up
/**
* getReportAndTemplate
*/
public String[] getReportAndTemplate(ims.vo.ValueObjectRef refVo)
{
	String[] result = null;
	
	if(refVo == null)
		return null;
	
	if(refVo instanceof UserAssessmentRefVo)
	{
			List list = getDomainFactory().find("select r1_1.reportXml, t1_1.templateXml \r\n" + 
					"from UserAssessment as u1_1 left join u1_1.associatedReport as t1_1 left join t1_1.report as r1_1\r\n" + 
					"where (u1_1.id = :ID) ", new String[] {"ID"}, new Object[] {refVo.getBoId()});

			if(list.iterator().hasNext())
			{
				Object[] obj = (Object[])list.iterator().next();
				
				result = new String[] {(String)obj[0], (String)obj[1]};
			}
	}
	
	return result;		
}
 
Example 13
Project: openmaxims-linux   File: ManchesterTreatmentProtocolAdminImpl.java   Source Code and License 6 votes vote down vote up
public Boolean checkForConfiguredAssessment(UserAssessmentRefVo userAssessmentShortVoRef) 
{
	if (userAssessmentShortVoRef == null)
		return false;

	DomainFactory factory = getDomainFactory();
	String hql = " from ProblemTriageProtocol ptp " +
	" where ptp.triageProtocol.id = :tp "; 

	List tpList = factory.find(hql,new String[]{"tp"}, new Object[]{userAssessmentShortVoRef.getID_UserAssessment()});

	if (tpList != null && tpList.size() > 0)
		return true;

	return false;
}
 
Example 14
Project: openmaxims-linux   File: AssessmentConfig.java   Source Code and License 6 votes vote down vote up
/**
 * @param voPatientUserDefinedObject
 * @param userAssessmentRefVo
 * @param graphicAssessmentRefVo
 * @return
 */
private UserDefinedObjectComponentVo getUserDefinedObjectComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, UserAssessmentRefVo userAssessmentRefVo, GraphicAssessmentRefVo graphicAssessmentRefVo)
{
	if (userAssessmentRefVo == null && graphicAssessmentRefVo == null)
		return null;

	if (voPatientUserDefinedObject != null && voPatientUserDefinedObject.getUserDefinedObjectIsNotNull())
	{
		for (int i = 0; i < voPatientUserDefinedObject.getUserDefinedObject().getComponents().size(); i++)
		{
			UserDefinedObjectComponentVo voUserDefinedObjectComponent = voPatientUserDefinedObject.getUserDefinedObject().getComponents().get(i);
			UserAssessmentRefVo userUserDefinedAssessmentRefVo = voUserDefinedObjectComponent.getUserAssessment();
			GraphicAssessmentRefVo graphicUserDefinedAssessmentRefVo = voUserDefinedObjectComponent.getGraphic();
			boolean sameUserAssessment = userUserDefinedAssessmentRefVo != null && userUserDefinedAssessmentRefVo.equals(userAssessmentRefVo);
			boolean sameGraphicAssessment = graphicUserDefinedAssessmentRefVo != null && graphicUserDefinedAssessmentRefVo.equals(graphicAssessmentRefVo);

			if (sameUserAssessment || sameGraphicAssessment)
				return voUserDefinedObjectComponent;
		}
	}

	return null;
}
 
Example 15
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 16
Project: AvoinApotti   File: TumourDetailsImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Domain Interface function used to retrieve a UserAssessment record
 */
public UserAssessmentVo getUserAssessment(UserAssessmentRefVo userAssessment)
{
	if (userAssessment == null || !userAssessment.getID_UserAssessmentIsNotNull())
		return null;
	
	return UserAssessmentVoAssembler.create((UserAssessment) getDomainFactory().getDomainObject(UserAssessment.class, userAssessment.getID_UserAssessment()));
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open(boolean showNoRecordsFoundMessage) throws PresentationLogicException 
{	
	clearInstanceControls();
	
	form.getLocalContext().setRIE(null);
	
	UserAssessmentRefVo structuralAssessmentRef = form.getLocalContext().getStructuralAssessmentRef();
	GraphicAssessmentRefVo graphicalAssessmentRef = form.getLocalContext().getGraphicalAssessmentRef();
	
	if(structuralAssessmentRef != null)
	{
		showStructuralTab();
		
		
		populateStructuralAssessmentControlsFromData(showNoRecordsFoundMessage);
		enableStructuredAssessmentHelpUrlImage(form.getLocalContext().getStructuralAssessment());
		
		//WDEV-9134
		getPreviousLastAssessment();
		
		refreshReport(form.getGlobalContext().Assessment.getDynamicAssessment());
	}
	else if(graphicalAssessmentRef != null)
	{
		showGraphicalTab();
		
		
		populateGraphicalAssessmentControlsFromData(showNoRecordsFoundMessage);
		enableGraphicalAssessmentHelpUrlImage(form.getLocalContext().getGraphicalAssessment());
	}
	else
	{
		throw new PresentationLogicException("Unknown assessment context");
	}
	
	updateControlsState();
}
 
Example 18
Project: AvoinApotti   File: AssessmentConfig.java   Source Code and License 5 votes vote down vote up
public UserDefinedObjectComponentVo getEditedComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, PatientAssessmentVo voPatientAssessment)
{
	if(voPatientAssessment == null)
		return null;
	if(voPatientUserDefinedObject == null)
		return null;
	
	UserAssessmentRefVo userAssessmentRefVo 	  = voPatientAssessment.getAssessmentData().getUserAssessment();
	GraphicAssessmentRefVo graphicAssessmentRefVo = voPatientAssessment.getAssessmentData().getGraphic();

	return getUserDefinedObjectComponent(voPatientUserDefinedObject, userAssessmentRefVo, graphicAssessmentRefVo);
}
 
Example 19
Project: AvoinApotti   File: AssessmentConfig.java   Source Code and License 5 votes vote down vote up
public UserDefinedObjectComponentVo getEditedComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, PatientAssessmentListVo voPatientAssessmentList)
{
	if(voPatientUserDefinedObject == null)
		return null;
	if(voPatientAssessmentList == null)
		return null;
	
	UserAssessmentRefVo userAssessmentRefVo 	  = voPatientAssessmentList.getAssessmentData().getUserAssessment();
	GraphicAssessmentRefVo graphicAssessmentRefVo = voPatientAssessmentList.getAssessmentData().getGraphic();
	
	return getUserDefinedObjectComponent(voPatientUserDefinedObject, userAssessmentRefVo, graphicAssessmentRefVo);
}
 
Example 20
Project: AvoinApotti   File: UserAssessmentNewImpl.java   Source Code and License 5 votes vote down vote up
public Boolean isExtraActiveThirdLevelAssessmentSaved(UserAssessmentRefVo userAssessmentRefVo, UserDefinedAssessmentType assessmentType)
{
	if(assessmentType == null)
		throw new CodingRuntimeException("Cannot UserAssessment for null UserDefinedAssessmentType");
	
	StringBuffer hql = new StringBuffer("from UserAssessment u ");
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	String andStr = " where ";
	
	hql.append(andStr + " u.activeStatus =:status");
	markers.add("status");
	values.add(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE));
	andStr = " and ";
	
	if(assessmentType != null)
	{
		hql.append(andStr + " u.assessmentType =:assType");
		markers.add("assType");
		values.add(getDomLookup(assessmentType));
		andStr = " and ";
	}
	
	if (userAssessmentRefVo != null && userAssessmentRefVo.getID_UserAssessmentIsNotNull())
	{
		hql.append(andStr);
		hql.append("u.id !=:uaId");
		markers.add("uaId");
		values.add(userAssessmentRefVo.getID_UserAssessment());
		andStr = " and ";
	}
		
	List list = getDomainFactory().find(hql.toString(), markers, values);
	return new Boolean(list != null && list.size() > 0?true:false);
}
 
Example 21
Project: AvoinApotti   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public User_AssessmentVo getStructuredAssessment(UserAssessmentRefVo assessmentRef)
{		
	if(assessmentRef == null || assessmentRef.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	//return User_AssessmentVoAssembler.create((UserAssessment)getDomainFactory().getDomainObject(assessmentRef));
	return assembleUserAssessment((UserAssessment)getDomainFactory().getDomainObject(assessmentRef));	//WDEV-12215
}
 
Example 22
Project: AvoinApotti   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContact, UserAssessmentRefVo userAssessment)
{
	if(clinicalContact == null || clinicalContact.getID_ClinicalContact() == null)
		throw new CodingRuntimeException("Invalid clinical contact");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.clinicalContact.id = :cc");
	markers.add("cc");
	values.add(clinicalContact.getID_ClinicalContact());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	List result = factory.find(query, markers, values);
	if(result == null || result.size() > 1)
		throw new RuntimeException("More than one patient assessment found");
	else if (result.size() == 0)
		return null;
	
	return Patient_AssessmentVoAssembler.create((PatientAssessment)result.get(0));
}
 
Example 23
Project: AvoinApotti   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentListVoCollection listPatientAssessments(EpisodeOfCareRefVo episodeOfCare, UserAssessmentRefVo userAssessment)
{
	if(episodeOfCare == null || episodeOfCare.getID_EpisodeOfCare() == null)
		throw new CodingRuntimeException("Invalid episode of care");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	//WDEV-11526
	hql.append(andStr + " a.episodeOfCare.id = :ec");
	markers.add("ec");
	values.add(episodeOfCare.getID_EpisodeOfCare());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return Patient_AssessmentListVoAssembler.createPatient_AssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 24
Project: AvoinApotti   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentListVoCollection listPatientAssessments(CareContextRefVo careContext, UserAssessmentRefVo userAssessment)
{
	if(careContext == null || careContext.getID_CareContext() == null)
		throw new CodingRuntimeException("Invalid care context");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.careContext.id = :cc");
	markers.add("cc");
	values.add(careContext.getID_CareContext());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return Patient_AssessmentListVoAssembler.createPatient_AssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 25
Project: AvoinApotti   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentWithServiceCollVo getUserAssessment(UserAssessmentRefVo assessRef) 
{
	if(assessRef == null)
		return null;
	UserAssessment domainUserAsses = (UserAssessment) getDomainFactory().getDomainObject(UserAssessment.class, assessRef.getID_UserAssessment());
	return UserAssessmentWithServiceCollVoAssembler.create(domainUserAsses);
}
 
Example 26
Project: AvoinApotti   File: DPPGroupingsConfigImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentVo getUserAssessment(UserAssessmentRefVo userAssessmentRefVo)
{
	if (userAssessmentRefVo == null)
		throw new CodingRuntimeException("Cannot get UserAssessmentVo for null UserAssessmentRefVo");
	DomainFactory factory = getDomainFactory();
	UserAssessment doUserAssessment = (UserAssessment) factory.getDomainObject(UserAssessment.class, userAssessmentRefVo.getID_UserAssessment());
	return UserAssessmentVoAssembler.create(doUserAssessment);
}
 
Example 27
Project: AvoinApotti   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContact, UserAssessmentRefVo userAssessment)
{
	if(clinicalContact == null || clinicalContact.getID_ClinicalContact() == null)
		throw new CodingRuntimeException("Invalid clinical contact");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.clinicalContact.id = :cc");
	markers.add("cc");
	values.add(clinicalContact.getID_ClinicalContact());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	List result = factory.find(query, markers, values);
	if(result == null || result.size() > 1)
		throw new RuntimeException("More than one patient assessment found");
	else if (result.size() == 0)
		return null;
	
	return PatientAssessmentVoAssembler.create((PatientAssessment)result.get(0));
}
 
Example 28
Project: AvoinApotti   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentVo getStructuredAssessment(UserAssessmentRefVo assessmentRef)
{
	if(assessmentRef == null || assessmentRef.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	return UserAssessmentVoAssembler.create((UserAssessment)getDomainFactory().getDomainObject(assessmentRef));
}
 
Example 29
Project: AvoinApotti   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentListVoCollection listPatientAssessments(CareContextRefVo careContext, UserAssessmentRefVo userAssessment)
{
	if(careContext == null || careContext.getID_CareContext() == null)
		throw new CodingRuntimeException("Invalid care context");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.careContext.id = :cc");
	markers.add("cc");
	values.add(careContext.getID_CareContext());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return PatientAssessmentListVoAssembler.createPatientAssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 30
Project: AvoinApotti   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentListVoCollection listPatientAssessments(EpisodeOfCareRefVo episodeOfCare, UserAssessmentRefVo userAssessment)
{
	if(episodeOfCare == null || episodeOfCare.getID_EpisodeOfCare() == null)
		throw new CodingRuntimeException("Invalid episode of care");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	//WDEV-11526
	hql.append(andStr + " a.episodeOfCare.id = :ec");
	markers.add("ec");
	values.add(episodeOfCare.getID_EpisodeOfCare());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return PatientAssessmentListVoAssembler.createPatientAssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 31
Project: AvoinApotti   File: PatientICPActionLinkedDetailsComponentImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentVo getAssessment(UserAssessmentRefVo assessmentRef)
{
	// Check parameter
	if (assessmentRef == null || !assessmentRef.getID_UserAssessmentIsNotNull())
		return null;

	return UserAssessmentVoAssembler.create((UserAssessment) getDomainFactory().getDomainObject(UserAssessment.class, assessmentRef.getID_UserAssessment()));
}
 
Example 32
Project: AvoinApotti   File: PatientICPActionLinkedDetailsComponentImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentLiteVoCollection listPatientAssessments(CareContextRefVo careContextRef, UserAssessmentRefVo assessmentRef)
{
	// If no assembler or care context is passes return null
	// Do not throw any exception or crash code - this is the domain of a component
	// Try to handle the execution exception
	if (assessmentRef == null || careContextRef == null)
		return null;
	
	CareContextLiteVo careContext = CareContextLiteVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, careContextRef.getID_CareContext()));
	
	if (careContext == null)
		return null;
			
	String query = " from PatientAssessment as pa where pa.assessmentData.userAssessment.id = :ASS_ID and ((pa.careContext.id = :CC_ID and pa.careContext.context.id != :CC_TYPE)" +
			" or (pa.careContext.episodeOfCare.id = :EP_ID and pa.careContext.context.id = :CC_TYPE)) order by pa.authoringInformation.authoringDateTime desc";
	
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();
	
	paramNames.add("ASS_ID");
	paramValues.add(assessmentRef.getID_UserAssessment());
	
	paramNames.add("CC_ID");
	paramValues.add(careContextRef.getID_CareContext());
	
	paramNames.add("CC_TYPE");
	paramValues.add(ContextType.INPATIENT.getID());
	
	paramNames.add("EP_ID");
	paramValues.add(careContext.getEpisodeOfCare().getID_EpisodeOfCare());

	
	return PatientAssessmentLiteVoAssembler.createPatientAssessmentLiteVoCollectionFromPatientAssessment(getDomainFactory().find(query, paramNames, paramValues));
}
 
Example 33
Project: openMAXIMS   File: TumourDetailsImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Domain Interface function used to retrieve a UserAssessment record
 */
public UserAssessmentVo getUserAssessment(UserAssessmentRefVo userAssessment)
{
	if (userAssessment == null || !userAssessment.getID_UserAssessmentIsNotNull())
		return null;
	
	return UserAssessmentVoAssembler.create((UserAssessment) getDomainFactory().getDomainObject(UserAssessment.class, userAssessment.getID_UserAssessment()));
}
 
Example 34
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open(boolean showNoRecordsFoundMessage) throws PresentationLogicException 
{	
	clearInstanceControls();
	
	form.getLocalContext().setRIE(null);
	
	UserAssessmentRefVo structuralAssessmentRef = form.getLocalContext().getStructuralAssessmentRef();
	GraphicAssessmentRefVo graphicalAssessmentRef = form.getLocalContext().getGraphicalAssessmentRef();
	
	if(structuralAssessmentRef != null)
	{
		showStructuralTab();
		
		
		populateStructuralAssessmentControlsFromData(showNoRecordsFoundMessage);
		enableStructuredAssessmentHelpUrlImage(form.getLocalContext().getStructuralAssessment());
		
		//WDEV-9134
		getPreviousLastAssessment();
		
		refreshReportTab(form.getGlobalContext().Assessment.getDynamicAssessment());
	}
	else if(graphicalAssessmentRef != null)
	{
		showGraphicalTab();
		
		
		populateGraphicalAssessmentControlsFromData(showNoRecordsFoundMessage);
		enableGraphicalAssessmentHelpUrlImage(form.getLocalContext().getGraphicalAssessment());
	}
	else
	{
		throw new PresentationLogicException("Unknown assessment context");
	}
	
	updateControlsState();
}
 
Example 35
Project: openMAXIMS   File: AssessmentConfig.java   Source Code and License 5 votes vote down vote up
public UserDefinedObjectComponentVo getEditedComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, PatientAssessmentVo voPatientAssessment)
{
	if(voPatientAssessment == null)
		return null;
	if(voPatientUserDefinedObject == null)
		return null;
	
	UserAssessmentRefVo userAssessmentRefVo 	  = voPatientAssessment.getAssessmentData().getUserAssessment();
	GraphicAssessmentRefVo graphicAssessmentRefVo = voPatientAssessment.getAssessmentData().getGraphic();

	return getUserDefinedObjectComponent(voPatientUserDefinedObject, userAssessmentRefVo, graphicAssessmentRefVo);
}
 
Example 36
Project: openMAXIMS   File: AssessmentConfig.java   Source Code and License 5 votes vote down vote up
public UserDefinedObjectComponentVo getEditedComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, PatientAssessmentListVo voPatientAssessmentList)
{
	if(voPatientUserDefinedObject == null)
		return null;
	if(voPatientAssessmentList == null)
		return null;
	
	UserAssessmentRefVo userAssessmentRefVo 	  = voPatientAssessmentList.getAssessmentData().getUserAssessment();
	GraphicAssessmentRefVo graphicAssessmentRefVo = voPatientAssessmentList.getAssessmentData().getGraphic();
	
	return getUserDefinedObjectComponent(voPatientUserDefinedObject, userAssessmentRefVo, graphicAssessmentRefVo);
}
 
Example 37
Project: openMAXIMS   File: UserAssessmentNewImpl.java   Source Code and License 5 votes vote down vote up
public Boolean isExtraActiveThirdLevelAssessmentSaved(UserAssessmentRefVo userAssessmentRefVo, UserDefinedAssessmentType assessmentType)
{
	if(assessmentType == null)
		throw new CodingRuntimeException("Cannot UserAssessment for null UserDefinedAssessmentType");
	
	StringBuffer hql = new StringBuffer("from UserAssessment u ");
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	String andStr = " where ";
	
	hql.append(andStr + " u.activeStatus =:status");
	markers.add("status");
	values.add(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE));
	andStr = " and ";
	
	if(assessmentType != null)
	{
		hql.append(andStr + " u.assessmentType =:assType");
		markers.add("assType");
		values.add(getDomLookup(assessmentType));
		andStr = " and ";
	}
	
	if (userAssessmentRefVo != null && userAssessmentRefVo.getID_UserAssessmentIsNotNull())
	{
		hql.append(andStr);
		hql.append("u.id !=:uaId");
		markers.add("uaId");
		values.add(userAssessmentRefVo.getID_UserAssessment());
		andStr = " and ";
	}
		
	List list = getDomainFactory().find(hql.toString(), markers, values);
	return new Boolean(list != null && list.size() > 0?true:false);
}
 
Example 38
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public User_AssessmentVo getStructuredAssessment(UserAssessmentRefVo assessmentRef)
{		
	if(assessmentRef == null || assessmentRef.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	//return User_AssessmentVoAssembler.create((UserAssessment)getDomainFactory().getDomainObject(assessmentRef));
	return assembleUserAssessment((UserAssessment)getDomainFactory().getDomainObject(assessmentRef));	//WDEV-12215
}
 
Example 39
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContact, UserAssessmentRefVo userAssessment)
{
	if(clinicalContact == null || clinicalContact.getID_ClinicalContact() == null)
		throw new CodingRuntimeException("Invalid clinical contact");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.clinicalContact.id = :cc");
	markers.add("cc");
	values.add(clinicalContact.getID_ClinicalContact());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	List<?> result = factory.find(query, markers, values);
	if(result == null || result.size() > 1)
		throw new RuntimeException("More than one patient assessment found");
	else if (result.size() == 0)
		return null;
	
	return Patient_AssessmentVoAssembler.create((PatientAssessment)result.get(0));
}
 
Example 40
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentListVoCollection listPatientAssessments(EpisodeOfCareRefVo episodeOfCare, UserAssessmentRefVo userAssessment)
{
	if(episodeOfCare == null || episodeOfCare.getID_EpisodeOfCare() == null)
		throw new CodingRuntimeException("Invalid episode of care");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	//WDEV-11526
	hql.append(andStr + " a.episodeOfCare.id = :ec");
	markers.add("ec");
	values.add(episodeOfCare.getID_EpisodeOfCare());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return Patient_AssessmentListVoAssembler.createPatient_AssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 41
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentListVoCollection listPatientAssessments(CareContextRefVo careContext, UserAssessmentRefVo userAssessment)
{
	if(careContext == null || careContext.getID_CareContext() == null)
		throw new CodingRuntimeException("Invalid care context");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.careContext.id = :cc");
	markers.add("cc");
	values.add(careContext.getID_CareContext());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return Patient_AssessmentListVoAssembler.createPatient_AssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 42
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentWithServiceCollVo getUserAssessment(UserAssessmentRefVo assessRef) 
{
	if(assessRef == null)
		return null;
	UserAssessment domainUserAsses = (UserAssessment) getDomainFactory().getDomainObject(UserAssessment.class, assessRef.getID_UserAssessment());
	return UserAssessmentWithServiceCollVoAssembler.create(domainUserAsses);
}
 
Example 43
Project: openMAXIMS   File: DPPGroupingsConfigImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentVo getUserAssessment(UserAssessmentRefVo userAssessmentRefVo)
{
	if (userAssessmentRefVo == null)
		throw new CodingRuntimeException("Cannot get UserAssessmentVo for null UserAssessmentRefVo");
	DomainFactory factory = getDomainFactory();
	UserAssessment doUserAssessment = (UserAssessment) factory.getDomainObject(UserAssessment.class, userAssessmentRefVo.getID_UserAssessment());
	return UserAssessmentVoAssembler.create(doUserAssessment);
}
 
Example 44
Project: openMAXIMS   File: EDWhiteBoardNewDialogImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentForWhiteboardVo getPatientAssessment(CareContextRefVo careContextRef, UserAssessmentRefVo userAssessmentRef)
{
	if(careContextRef==null || userAssessmentRef==null)
		throw new CodingRuntimeException("Cannot get PatientAssessment value on null Care context or null User Assessment.");
	
	StringBuffer hql = new StringBuffer();
	hql.append("select patAssess from PatientAssessment as patAssess left join patAssess.assessmentData as patAssessData where patAssess.careContext.id = :careContextID  and patAssessData.userAssessment.id= :userAssessID and (patAssess.isRIE is null or patAssess.isRIE=0) ");
	
	DomainFactory factory = getDomainFactory();
	DomainObject doPatAssess = factory.findFirst(hql.toString(), new String[] {"careContextID","userAssessID"}, new Object[] {careContextRef.getID_CareContext(), userAssessmentRef.getID_UserAssessment()});
	
	return PatientAssessmentForWhiteboardVoAssembler.create((PatientAssessment) doPatAssess);
}
 
Example 45
Project: openMAXIMS   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContact, UserAssessmentRefVo userAssessment)
{
	if(clinicalContact == null || clinicalContact.getID_ClinicalContact() == null)
		throw new CodingRuntimeException("Invalid clinical contact");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.clinicalContact.id = :cc");
	markers.add("cc");
	values.add(clinicalContact.getID_ClinicalContact());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	List result = factory.find(query, markers, values);
	if(result == null || result.size() > 1)
		throw new RuntimeException("More than one patient assessment found");
	else if (result.size() == 0)
		return null;
	
	return PatientAssessmentVoAssembler.create((PatientAssessment)result.get(0));
}
 
Example 46
Project: openMAXIMS   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentVo getStructuredAssessment(UserAssessmentRefVo assessmentRef)
{
	if(assessmentRef == null || assessmentRef.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	return UserAssessmentVoAssembler.create((UserAssessment)getDomainFactory().getDomainObject(assessmentRef));
}
 
Example 47
Project: openMAXIMS   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentListVoCollection listPatientAssessments(CareContextRefVo careContext, UserAssessmentRefVo userAssessment)
{
	if(careContext == null || careContext.getID_CareContext() == null)
		throw new CodingRuntimeException("Invalid care context");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.careContext.id = :cc");
	markers.add("cc");
	values.add(careContext.getID_CareContext());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return PatientAssessmentListVoAssembler.createPatientAssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 48
Project: openMAXIMS   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentListVoCollection listPatientAssessments(EpisodeOfCareRefVo episodeOfCare, UserAssessmentRefVo userAssessment)
{
	if(episodeOfCare == null || episodeOfCare.getID_EpisodeOfCare() == null)
		throw new CodingRuntimeException("Invalid episode of care");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	//WDEV-11526
	hql.append(andStr + " a.episodeOfCare.id = :ec");
	markers.add("ec");
	values.add(episodeOfCare.getID_EpisodeOfCare());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return PatientAssessmentListVoAssembler.createPatientAssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 49
Project: openMAXIMS   File: PatientICPActionLinkedDetailsComponentImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentVo getAssessment(UserAssessmentRefVo assessmentRef)
{
	// Check parameter
	if (assessmentRef == null || !assessmentRef.getID_UserAssessmentIsNotNull())
		return null;

	return UserAssessmentVoAssembler.create((UserAssessment) getDomainFactory().getDomainObject(UserAssessment.class, assessmentRef.getID_UserAssessment()));
}
 
Example 50
Project: openMAXIMS   File: IntraOperativeCaseDetailsDialogImpl.java   Source Code and License 5 votes vote down vote up
public User_AssessmentVo getUserAssessment(UserAssessmentRefVo userAssessment)
{
	if (userAssessment == null)
		return null;

	DomainFactory factory = getDomainFactory();
	UserAssessment obj = (UserAssessment) factory.getDomainObject(UserAssessment.class, userAssessment.getID_UserAssessment());

	return User_AssessmentVoAssembler.create(obj);
}
 
Example 51
Project: openMAXIMS   File: TumourDetailsImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Domain Interface function used to retrieve a UserAssessment record
 */
public UserAssessmentVo getUserAssessment(UserAssessmentRefVo userAssessment)
{
	if (userAssessment == null || !userAssessment.getID_UserAssessmentIsNotNull())
		return null;
	
	return UserAssessmentVoAssembler.create((UserAssessment) getDomainFactory().getDomainObject(UserAssessment.class, userAssessment.getID_UserAssessment()));
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open(boolean showNoRecordsFoundMessage) throws PresentationLogicException 
{	
	clearInstanceControls();
	
	form.getLocalContext().setRIE(null);
	
	UserAssessmentRefVo structuralAssessmentRef = form.getLocalContext().getStructuralAssessmentRef();
	GraphicAssessmentRefVo graphicalAssessmentRef = form.getLocalContext().getGraphicalAssessmentRef();
	
	if(structuralAssessmentRef != null)
	{
		showStructuralTab();
		
		
		populateStructuralAssessmentControlsFromData(showNoRecordsFoundMessage);
		enableStructuredAssessmentHelpUrlImage(form.getLocalContext().getStructuralAssessment());
		
		//WDEV-9134
		getPreviousLastAssessment();
		
		refreshReport(form.getGlobalContext().Assessment.getDynamicAssessment());
	}
	else if(graphicalAssessmentRef != null)
	{
		showGraphicalTab();
		
		
		populateGraphicalAssessmentControlsFromData(showNoRecordsFoundMessage);
		enableGraphicalAssessmentHelpUrlImage(form.getLocalContext().getGraphicalAssessment());
	}
	else
	{
		throw new PresentationLogicException("Unknown assessment context");
	}
	
	updateControlsState();
}
 
Example 53
Project: openMAXIMS   File: AssessmentConfig.java   Source Code and License 5 votes vote down vote up
public UserDefinedObjectComponentVo getEditedComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, PatientAssessmentVo voPatientAssessment)
{
	if(voPatientAssessment == null)
		return null;
	if(voPatientUserDefinedObject == null)
		return null;
	
	UserAssessmentRefVo userAssessmentRefVo 	  = voPatientAssessment.getAssessmentData().getUserAssessment();
	GraphicAssessmentRefVo graphicAssessmentRefVo = voPatientAssessment.getAssessmentData().getGraphic();

	return getUserDefinedObjectComponent(voPatientUserDefinedObject, userAssessmentRefVo, graphicAssessmentRefVo);
}
 
Example 54
Project: openMAXIMS   File: AssessmentConfig.java   Source Code and License 5 votes vote down vote up
public UserDefinedObjectComponentVo getEditedComponent(PatientUserDefinedObjectVo voPatientUserDefinedObject, PatientAssessmentListVo voPatientAssessmentList)
{
	if(voPatientUserDefinedObject == null)
		return null;
	if(voPatientAssessmentList == null)
		return null;
	
	UserAssessmentRefVo userAssessmentRefVo 	  = voPatientAssessmentList.getAssessmentData().getUserAssessment();
	GraphicAssessmentRefVo graphicAssessmentRefVo = voPatientAssessmentList.getAssessmentData().getGraphic();
	
	return getUserDefinedObjectComponent(voPatientUserDefinedObject, userAssessmentRefVo, graphicAssessmentRefVo);
}
 
Example 55
Project: openMAXIMS   File: UserAssessmentNewImpl.java   Source Code and License 5 votes vote down vote up
public Boolean isExtraActiveThirdLevelAssessmentSaved(UserAssessmentRefVo userAssessmentRefVo, UserDefinedAssessmentType assessmentType)
{
	if(assessmentType == null)
		throw new CodingRuntimeException("Cannot UserAssessment for null UserDefinedAssessmentType");
	
	StringBuffer hql = new StringBuffer("from UserAssessment u ");
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	String andStr = " where ";
	
	hql.append(andStr + " u.activeStatus =:status");
	markers.add("status");
	values.add(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE));
	andStr = " and ";
	
	if(assessmentType != null)
	{
		hql.append(andStr + " u.assessmentType =:assType");
		markers.add("assType");
		values.add(getDomLookup(assessmentType));
		andStr = " and ";
	}
	
	if (userAssessmentRefVo != null && userAssessmentRefVo.getID_UserAssessmentIsNotNull())
	{
		hql.append(andStr);
		hql.append("u.id !=:uaId");
		markers.add("uaId");
		values.add(userAssessmentRefVo.getID_UserAssessment());
		andStr = " and ";
	}
		
	List list = getDomainFactory().find(hql.toString(), markers, values);
	return new Boolean(list != null && list.size() > 0?true:false);
}
 
Example 56
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public User_AssessmentVo getStructuredAssessment(UserAssessmentRefVo assessmentRef)
{		
	if(assessmentRef == null || assessmentRef.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	//return User_AssessmentVoAssembler.create((UserAssessment)getDomainFactory().getDomainObject(assessmentRef));
	return assembleUserAssessment((UserAssessment)getDomainFactory().getDomainObject(assessmentRef));	//WDEV-12215
}
 
Example 57
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContact, UserAssessmentRefVo userAssessment)
{
	if(clinicalContact == null || clinicalContact.getID_ClinicalContact() == null)
		throw new CodingRuntimeException("Invalid clinical contact");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.clinicalContact.id = :cc");
	markers.add("cc");
	values.add(clinicalContact.getID_ClinicalContact());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	List result = factory.find(query, markers, values);
	if(result == null || result.size() > 1)
		throw new RuntimeException("More than one patient assessment found");
	else if (result.size() == 0)
		return null;
	
	return Patient_AssessmentVoAssembler.create((PatientAssessment)result.get(0));
}
 
Example 58
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentListVoCollection listPatientAssessments(EpisodeOfCareRefVo episodeOfCare, UserAssessmentRefVo userAssessment)
{
	if(episodeOfCare == null || episodeOfCare.getID_EpisodeOfCare() == null)
		throw new CodingRuntimeException("Invalid episode of care");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	//WDEV-11526
	hql.append(andStr + " a.episodeOfCare.id = :ec");
	markers.add("ec");
	values.add(episodeOfCare.getID_EpisodeOfCare());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return Patient_AssessmentListVoAssembler.createPatient_AssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 59
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentListVoCollection listPatientAssessments(CareContextRefVo careContext, UserAssessmentRefVo userAssessment)
{
	if(careContext == null || careContext.getID_CareContext() == null)
		throw new CodingRuntimeException("Invalid care context");
	if(userAssessment == null || userAssessment.getID_UserAssessment() == null)
		throw new CodingRuntimeException("Invalid user assessment");
	
	DomainFactory factory = getDomainFactory();		
	StringBuffer hql = new StringBuffer();
	String query = " from PatientAssessment a ";
	ArrayList<String> markers= new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	String andStr = " ";

	hql.append(andStr + " a.careContext.id = :cc");
	markers.add("cc");
	values.add(careContext.getID_CareContext());
	andStr = " and ";
	
	hql.append(andStr + " a.assessmentData.userAssessment.id = :ua");
	markers.add("ua");
	values.add(userAssessment.getID_UserAssessment());
	
	if (markers.size() > 0) 
		query += " where ";
	query += hql.toString();	
	
	query += " order by a.authoringInformation.authoringDateTime desc";
	
	return Patient_AssessmentListVoAssembler.createPatient_AssessmentListVoCollectionFromPatientAssessment(factory.find(query, markers, values));
}
 
Example 60
Project: openMAXIMS   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public UserAssessmentWithServiceCollVo getUserAssessment(UserAssessmentRefVo assessRef) 
{
	if(assessRef == null)
		return null;
	UserAssessment domainUserAsses = (UserAssessment) getDomainFactory().getDomainObject(UserAssessment.class, assessRef.getID_UserAssessment());
	return UserAssessmentWithServiceCollVoAssembler.create(domainUserAsses);
}