Java Code Examples for ims.core.admin.vo.ClinicalContactRefVo

The following are top voted examples for showing how to use ims.core.admin.vo.ClinicalContactRefVo. 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: MedAdmisSummImpl.java   Source Code and License 6 votes vote down vote up
public NeuroMotorFindingsVo getNeuroMotorFinding(ClinicalContactRefVo voClinContact) 
{
	if(voClinContact == null)
		throw new DomainRuntimeException("Clinical Contact must not be null");

	DomainFactory factory = getDomainFactory();
	String hql = "from NeuExamMotor neuExamMotor where neuExamMotor.clinicalContact.id = :id_ClinContact ";
	List list = factory.find(hql, new String[] {"id_ClinContact"}, new Object[] {voClinContact.getID_ClinicalContact()});
			
	if(list != null && list.size() > 0)
	{
		NeuroMotorFindingsVoCollection collNeuroMotorFindings = NeuroMotorFindingsVoAssembler.createNeuroMotorFindingsVoCollectionFromNeuExamMotor(list);
		if(collNeuroMotorFindings != null && collNeuroMotorFindings.size() > 0)
			return collNeuroMotorFindings.get(0);
	}
	
	return null;	
		
}
 
Example 2
Project: AvoinApotti   File: MedNeuroMotorPrototypeImpl.java   Source Code and License 6 votes vote down vote up
/**
* list all NeuroMotor records for the CareContext
*/
public NeuroMotorFindingsShortVoCollection listFindings(CareContextRefVo careContext, ClinicalContactRefVo clinicalContact)
{
	if (careContext == null || !careContext.getID_CareContextIsNotNull())
		throw new DomainRuntimeException("Logical error - Can not search without a provided care context");
	
	StringBuilder query = new StringBuilder();
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();
	
	query.append("from NeuExamMotor as neuExam where neuExam.careContext.id = :ContextID");
	
	paramNames.add("ContextID");
	paramValues.add(careContext.getID_CareContext());
	
	if (clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
	{
		query.append(" and neuExam.clinicalContact.id = :ContactID");
		
		paramNames.add("ContactID");
		paramValues.add(clinicalContact.getID_ClinicalContact());
	}
	
	return NeuroMotorFindingsShortVoAssembler.createNeuroMotorFindingsShortVoCollectionFromNeuExamMotor(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
 
Example 3
Project: AvoinApotti   File: InjuryDetailsImpl.java   Source Code and License 6 votes vote down vote up
public InjuryDetailsVoCollection getInjuryDetailsByMedicalAdmissionClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
	if(voClinicalContactRef == null)
		throw new CodingRuntimeException("Contact not Provided");
	
	DomainFactory factory = getDomainFactory();
	
	//the following query retrievs the one and only contact of type spinalmedicaladmission if it has been instantiated
	List injuries =   factory.find(" from InjuryDetails inj where inj.clinicalContact.id = " + 
			"( select cons.id from ClinicalContact con join con.careContext.clinicalContacts cons where cons.contactType = :type and con.id = :idClinContact )order by inj.systemInformation.creationDateTime desc ",
			new String[]{"type", "idClinContact" },
			new Object[]{ getDomLookup(ContactType.SPINALMEDICALADMISSION),voClinicalContactRef.getID_ClinicalContact()});  //wdev-13529

	InjuryDetailsVoCollection voCollInjuries = InjuryDetailsVoAssembler.createInjuryDetailsVoCollectionFromInjuryDetails(injuries);
	
	return voCollInjuries;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void browseRecored()
{
	clearScreen();
	updateBrowseInformation();
	form.getLocalContext().setCurrentMassageVo(null);
	if(form.recbrMassage().getValue() != null)
	{
		if(engine.isRIEMode()){
			if(form.recbrMassage().getValue() instanceof MassageShortVo){
				MassageShortVo voMassageShort = (MassageShortVo)form.recbrMassage().getValue();
				form.getLocalContext().setCurrentMassageVo(domain.getMassageVo(voMassageShort.getID_Massage()));
				populateScreenFromData();
			}
		}
		else if(form.recbrMassage().getValue() instanceof ClinicalContactShortVo)
		{
			form.getLocalContext().setCurrentMassageVo(domain.getMassageVoByClinicalContact((ClinicalContactRefVo) form.recbrMassage().getValue()));
			populateScreenFromData();
		}
	}
	isRecordEditable();
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void browseRecord()
{
	clearControls();
	prePopulateSportsGrd();
	
	updateBrowseInformation();
	if(form.recbrSports().getValue() != null)
	{
		if(form.recbrSports().getValue() instanceof ClinicalContactShortVo)
		{
			form.getLocalContext().setSportsActivitySession(domain.getSportsActivityByClinicalContact((ClinicalContactRefVo) form.recbrSports().getValue()));
			populateInstanceControls();
		}
	}
	isRecordEditable();
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void browserRecord()
{
	clearInstanceControls();
	form.getLocalContext().setHomeVisitVo(null);
	if(form.recbrContact().getValue() instanceof HomeVisitShortVo)
	{
		form.getLocalContext().setHomeVisitVo(domain.getHomeVisit((HomeVisitRefVo) form.recbrContact().getValue()));
	}
	if(form.recbrContact().getValue() instanceof ClinicalContactShortVo)
	{
		form.getLocalContext().setHomeVisitVo(domain.getHomeVisitAccByClinicalContact((ClinicalContactRefVo) form.recbrContact().getValue()));
	}
	if(form.recbrContact().getValue() instanceof CareContextVo)
	{
		form.getLocalContext().setHomeVisitVo(domain.getHomeVisitAccByCareContext((CareContextRefVo) form.recbrContact().getValue()));
	}
	
	populateScreen();
	isRecordEditable();
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void isRecordEditable()
{
	if(form.recbrContact().getValue()!= null)
	{
		if(form.recbrContact().getValue() instanceof ClinicalContactShortVo && form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()
				&& form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact().equals(((ClinicalContactRefVo) form.recbrContact().getValue()).getID_ClinicalContact()))
		{
			displayButtonsForRecord();
		}
		else if((form.recbrContact().getValue() instanceof CareContextShortVo || form.recbrContact().getValue() instanceof HomeVisitShortVo) && form.getGlobalContext().Core.getCurrentClinicalContact() == null)
		{
			//If the current Care Context is selected then there is always an option of many environment records.
			displayButtonsForRecord();
			form.btnNew().setVisible(true);
			form.btnNew().setEnabled(true);
		}
		else
			showButtonsForRecord(false, false);
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void isRecordEditable()
{
	if(form.recbrEnvironment().getValue()!= null)
	{
		if(form.recbrEnvironment().getValue() instanceof ClinicalContactShortVo && form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()
				&& form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact().equals(((ClinicalContactRefVo) form.recbrEnvironment().getValue()).getID_ClinicalContact()))
		{
			displayButtonsForRecord();
		}
		else if((form.recbrEnvironment().getValue() instanceof CareContextShortVo || form.recbrEnvironment().getValue() instanceof EnvironmentalVisitShortVo) && form.getGlobalContext().Core.getCurrentClinicalContact() == null)
		{
			//If the current Care Context is selected then there is always an option of many environment records.
			displayButtonsForRecord();
			form.btnNew().setVisible(true);
			form.btnNew().setEnabled(true);
		}
		else
			hideButtons();
	}
}
 
Example 9
Project: AvoinApotti   File: EnvironmentalVisitImpl.java   Source Code and License 6 votes vote down vote up
public EnvironmentalVisitVo getEnvironmentalVisitByClinicalContact(ClinicalContactRefVo voClinicalContactRef) 
{
	if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
		throw new DomainRuntimeException("Contact not provided for get call. ");

	DomainFactory factory = getDomainFactory();
	
	java.util.List environVisitList = factory.find("from  EnvironmentalVisit environList where environList.clinicalContact.id = :contactId ", new String[]{"contactId"}, new Object[]{voClinicalContactRef.getID_ClinicalContact()});
	
	EnvironmentalVisitVoCollection  coll = null;
	if  ((environVisitList != null) && (environVisitList.size()>0))
		coll = EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(environVisitList);
		
	if(coll != null && coll.size()>0)
		return coll.get(0);

	return null;
}
 
Example 10
Project: AvoinApotti   File: ExtendedClinicalNotesImpl.java   Source Code and License 6 votes vote down vote up
/**
* getClinicalNotes
*/
public ims.core.vo.ClinicalNotesVo getClinicalNotes(ims.core.admin.vo.ClinicalContactRefVo contactVo) 
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer(" from ClinicalNotes clinnote where "); 
	String andStr = " ";

	ArrayList<String> markers = new ArrayList<String>();
	ArrayList<Integer> values = new ArrayList<Integer>();

	hql.append(andStr + " clinnote.clinicalContact.id = :ccId");
		markers.add("ccId");
	values.add(contactVo.getID_ClinicalContact());
	andStr = " and ";	

	List<?> listNotes = factory.find(hql.toString(), markers,values);
	if(listNotes != null && listNotes.size() > 0)
	{ 
		ClinicalNotesVoCollection voColl = ClinicalNotesVoAssembler.createClinicalNotesVoCollectionFromClinicalNotes(listNotes);
		if(voColl != null && voColl.size() > 0)
			return voColl.get(0);
	}
	return null;
}
 
Example 11
Project: AvoinApotti   File: HydrotherapyImpl.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13587
 * Retrieve Hydrotherapy record based on ClinicalContact
 * Depending on RIE parameter will retrieve RIE or non-RIE record
 */
public HydrotherapyVo getHydroTherapy(ClinicalContactRefVo voClinicalContact, Boolean modeRIE)
{
	if (voClinicalContact == null)
		throw new RuntimeException("Cannot get Hidrotherapy record for null Clinical Contact");

	StringBuffer query = new StringBuffer("from Hydrotherapy as hyd where hyd.clinicalContact.id = :CCID ");
	
	if (Boolean.TRUE.equals(modeRIE))
	{
		query.append(" and hyd.isRIE = 1 order by hyd.systemInformation.creationDateTime desc");
	}
	else
	{
		query.append(" and hyd.isRIE is null order by hyd.systemInformation.creationDateTime desc");
	}

	return HydrotherapyVoAssembler.create((Hydrotherapy) getDomainFactory().findFirst(query.toString(), "CCID", voClinicalContact.getID_ClinicalContact()));
}
 
Example 12
Project: AvoinApotti   File: FunctionalTransfersImpl.java   Source Code and License 6 votes vote down vote up
private boolean existsRecord(ClinicalContactRefVo clinicalContact)
{
	if (clinicalContact == null || !clinicalContact.getID_ClinicalContactIsNotNull())
		throw new DomainRuntimeException("Invalid parameter Clinical Contact");
	
	String query = "select COUNT (ft.id) from FunctionalTransfers as ft where ft.clinicalContact.id = :CCID and ft.isRIE <> 1";

	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();
	
	paramNames.add("CCID");
	paramValues.add(clinicalContact.getID_ClinicalContact());
	
	Object[] count = getDomainFactory().find(query, paramNames, paramValues).toArray();
	
	if (count != null && count.length > 0 && ((Long)count[0]).intValue() > 0)
		return true;

	return false;
}
 
Example 13
Project: AvoinApotti   File: BalanceActivitiesImpl.java   Source Code and License 6 votes vote down vote up
public BalanceActivitiesVo getBalanceActivitiesByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
	if (voClinicalContactRef == null)
		throw new RuntimeException("Cannot get Balance Activity for null Clinical Contact");

	StringBuffer query = new StringBuffer("from BalanceActivities as b1_1 where b1_1.clinicalContact.id = :CCID order by b1_1.systemInformation.creationDateTime desc"); //wdev-13637

	List list = getDomainFactory().find(query.toString(), "CCID", voClinicalContactRef.getID_ClinicalContact());

	if (list == null || list.size() == 0)
		return null;
	
	BalanceActivitiesVoCollection voColl = BalanceActivitiesVoAssembler.createBalanceActivitiesVoCollectionFromBalanceActivities(list);
	if (voColl != null && voColl.size() > 0)
	{						
		return voColl.get(0);
	}

	return null;
}
 
Example 14
Project: AvoinApotti   File: SportsActivitiesImpl.java   Source Code and License 6 votes vote down vote up
/**
* lists Sports Activity Session for ClinicalContact
*/
public SportsActivitySessionVo getSportsActivityByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
	if(voClinicalContactRef == null)
		throw new CodingRuntimeException("Sports Activity Filter not provided for get call. ");
	
	String hql = new String("from SportsActivitySession s where s.clinicalContact.id = :CLINICAL_CONTACT_ID order by s.authoringDateTime desc ");

	java.util.List list = getDomainFactory().find(hql, "CLINICAL_CONTACT_ID", voClinicalContactRef.getID_ClinicalContact());

	if (list.size() == 0)
		return null;
	
	SportsActivitySessionVoCollection vo = SportsActivitySessionVoAssembler.createSportsActivitySessionVoCollectionFromSportsActivitySession(list);
	
	if(vo!=null && vo.size()>0)
		return vo.get(0);
	
	return null;
}
 
Example 15
Project: AvoinApotti   File: RemedialImpl.java   Source Code and License 6 votes vote down vote up
/**
* Get the current Remedial record for the Clinical Contact 
*/
public ims.therapies.vo.RemedialVo getRemedialVoByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
	//return RemedialVoAssembler.create(Remedial.getRemedialFromClinicalContact(getDomainFactory(), voClinicalContactRef.getID_ClinicalContact()));
	//WDEV-15078
	if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact()==null )
		throw new CodingRuntimeException("Can not get RemedialVo value on null ClinicalContact.");
	
	
	StringBuffer hql = new StringBuffer();
	hql.append("select remedial from Remedial as remedial ");
	hql.append("where remedial.clinicalContact.id = :clinicalId ");
	
	DomainFactory factory = getDomainFactory();
	List<?> list = factory.find(hql.toString(), new String[] {"clinicalId"}, new Object[] {voClinicalContactRef.getID_ClinicalContact()});
	
	if (list!=null && list.size()>0)
	{
		return RemedialVoAssembler.createRemedialVoCollectionFromRemedial(list).get(0);
	}
	return null;
	
}
 
Example 16
Project: AvoinApotti   File: RemedialImpl.java   Source Code and License 6 votes vote down vote up
public Boolean existRemedialForClinicalContact(ClinicalContactRefVo clinicalContactRef)
{
	if (clinicalContactRef == null || clinicalContactRef.getID_ClinicalContact() == null)
	{
		throw new CodingRuntimeException("Cannot get Remedial on null Id for ClinicalContact ");
	}

	StringBuffer hql = new StringBuffer();
	hql.append("select count(remedial.id) from Remedial as remedial ");
	hql.append("where (remedial.clinicalContact.id = :clinicalId and (remedial.isRIE is null or remedial.isRIE = 0)) ");
	
	DomainFactory factory = getDomainFactory();
	Object[] count = factory.find(hql.toString(), new String[] {"clinicalId"}, new Object[] {clinicalContactRef.getID_ClinicalContact()}).toArray();
	
	if (count != null && count.length > 0)
		if (((Long) count[0]).intValue() > 0)
			return true;

	return false;
}
 
Example 17
Project: AvoinApotti   File: HomeVisitAccessImpl.java   Source Code and License 6 votes vote down vote up
public HomeVisitVo getHomeVisitAccByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
	if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
		throw new DomainRuntimeException("Contact not provided for get call. ");

	DomainFactory factory = getDomainFactory();
	
	java.util.List home = factory.find("from HomeVisit hv where hv.clinicalContact.id = :contactId", new String[]{"contactId"}, new Object[]{voClinicalContactRef.getID_ClinicalContact()});
	
	if  ((home != null) && (home.size()>0)){
		HomeVisitVoCollection collHomeVisit  = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);
		if(collHomeVisit!=null && collHomeVisit.size()!=0)
			return collHomeVisit.get(0);
	}

	return null;
}
 
Example 18
Project: AvoinApotti   File: MassageImpl.java   Source Code and License 6 votes vote down vote up
public MassageVo getMassageVoByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
	if (voClinicalContactRef == null)
		throw new RuntimeException("Cannot get Massage record for null ClinicalContactRefVo");

	StringBuffer query = new StringBuffer("from Massage as m1_1 where m1_1.clinicalContact.id = :CCID order by m1_1.systemInformation.creationDateTime desc");

	List list = getDomainFactory().find(query.toString(), "CCID", voClinicalContactRef.getID_ClinicalContact());

	if (list == null || list.size() == 0)
		return null;
	
	MassageVoCollection voColl = MassageVoAssembler.createMassageVoCollectionFromMassage(list);
	if (voColl.size() > 0)
		return voColl.get(0);

	return null;
}
 
Example 19
Project: AvoinApotti   File: StretchingImpl.java   Source Code and License 6 votes vote down vote up
private boolean existsRecord(ClinicalContactRefVo clinicalContact)
{
	if (clinicalContact == null || !clinicalContact.getID_ClinicalContactIsNotNull())
		throw new DomainRuntimeException("Invalid parameter Clinical Contact");
	
	String query = "select COUNT (st.id) from Stretching as st where st.clinicalContact.id = :CCID and st.isRIE <> 1";

	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();
	
	paramNames.add("CCID");
	paramValues.add(clinicalContact.getID_ClinicalContact());
	
	Object[] count = getDomainFactory().find(query, paramNames, paramValues).toArray();
	
	if (count != null && count.length > 0 && ((Long)count[0]).intValue() > 0)
		return true;

	return false;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void selectClinicalNoteInGlobalContext()
{

	ClinicalNotesVo clinicalNotesVoForContact = null;

	try
	{
		clinicalNotesVoForContact = domain.getClinicalNotesForContact((ClinicalContactRefVo) form.dyngrdList().getSelectedRow().getValue());
	}
	catch (RuntimeException e)
	{
		engine.showMessage(e.getMessage());
	}

	ClinicalNotesShortVo clinicalNotesForContact = null;

	if (clinicalNotesVoForContact != null)
		clinicalNotesForContact = domain.getClinicalNotesShort(clinicalNotesVoForContact.getID_ClinicalNotes());
	form.getGlobalContext().Core.setClinicalNotesShort(clinicalNotesForContact);

	if (clinicalNotesVoForContact != null)
		form.getGlobalContext().Clinical.setCurrentClinicalNote(clinicalNotesVoForContact);
	else
		form.getGlobalContext().Clinical.setCurrentClinicalNote(null);
}
 
Example 21
Project: AvoinApotti   File: PatientDiagnosisChecklistImpl.java   Source Code and License 6 votes vote down vote up
public PatientDiagnosisChecklistVo getPatientDiagnosisChecklistVo(ClinicalContactRefVo clinicalContact) {
	if(clinicalContact == null)
		throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer("from PatientDiagnosisChecklist p ");
	hql.append(" where (p.clinicalContact.id = " + clinicalContact.getID_ClinicalContact() + ")");
	List list = (factory.find(hql.toString()));
	PatientDiagnosisChecklistVoCollection collPatientDiagnosisChecklist = PatientDiagnosisChecklistVoAssembler.createPatientDiagnosisChecklistVoCollectionFromPatientDiagnosisChecklist(list);

	if(collPatientDiagnosisChecklist==null || collPatientDiagnosisChecklist.size()==0)
		return null;
	
	return collPatientDiagnosisChecklist.get(0);
}
 
Example 22
Project: AvoinApotti   File: ClinicalNoteDrawingImpl.java   Source Code and License 6 votes vote down vote up
public PatientAssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContactRefVo) 
{
	if(clinicalContactRefVo == null)
		throw new RuntimeException("Cannot get PatientAssessmentVo for null ClinicalContactRefVo");
	
	//WDEV-2432
	StringBuffer query = new StringBuffer("from PatientAssessment as p1_1 where");
	query.append(" p1_1.clinicalContact.id = :idCC");
	query.append(" and p1_1.assessmentData.graphic.assessmentType = :assessmentType");
	
	ArrayList<String> params = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	params.add("idCC");
	params.add("assessmentType");
	
	values.add(clinicalContactRefVo.getID_ClinicalContact());
	values.add(getDomLookup(UserDefinedAssessmentType.MEDICALNOTING));

	List list = getDomainFactory().find(query.toString(), params, values);
	PatientAssessmentVoCollection voColl = PatientAssessmentVoAssembler.createPatientAssessmentVoCollectionFromPatientAssessment(list);
	if(voColl != null && voColl.size() > 0)
		return voColl.get(0);
		
	return null;	
}
 
Example 23
Project: AvoinApotti   File: MedInvPlanImpl.java   Source Code and License 5 votes vote down vote up
public InvPlanVo getInvPlanVoByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
	DomainFactory factory = getDomainFactory();	
	
	InvPlanVoCollection voCollInvPlan = new InvPlanVoCollection();
	
	String hql = " from InvAndPlan invAndPlan "; 
	StringBuffer condStr = new StringBuffer();
	String andStr = " ";

	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();

	condStr.append(andStr + " invAndPlan.clinicalContact.id = :id_ClinicalContact"); 
	markers.add("id_ClinicalContact");
	values.add(voClinicalContactRef.getID_ClinicalContact());
	andStr = " and ";
			
	if (andStr.equals(" and "))
		hql += " where ";

	hql += condStr.toString();
	voCollInvPlan = InvPlanVoAssembler.createInvPlanVoCollectionFromInvAndPlan(factory.find(hql, markers, values));
	if(voCollInvPlan.size()>0)
		return voCollInvPlan.get(0);
	else
		return null;
}
 
Example 24
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 25
Project: AvoinApotti   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public Patient_AssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContact, GraphicAssessmentRefVo graphicalAssessment)
{
	if(clinicalContact == null || clinicalContact.getID_ClinicalContact() == null)
		throw new CodingRuntimeException("Invalid clinical contact");
	if(graphicalAssessment == null || graphicalAssessment.getID_GraphicAssessment() == null)
		throw new CodingRuntimeException("Invalid graphical 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.graphic.id = :ga");
	markers.add("ga");
	values.add(graphicalAssessment.getID_GraphicAssessment());
	
	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 26
Project: AvoinApotti   File: DynamicAssessmentsImpl.java   Source Code and License 5 votes vote down vote up
public ClinicalContactShortVo getClinicalContactShort(ClinicalContactRefVo clinicacalContactRefVo)
{
	if (clinicacalContactRefVo == null)
		return null;

	ClinicalContact doClinicalContact = (ClinicalContact) getDomainFactory().getDomainObject(ClinicalContact.class, clinicacalContactRefVo.getID_ClinicalContact());
	return ClinicalContactShortVoAssembler.create(doClinicalContact);

}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getContextInformation(CareContextRefVo careContextRef, ClinicalContactRefVo clinicalContactRef)
{
	StringBuilder contextInfo = new StringBuilder();

	CareContextShortVo careContext = domain.getCareContext(careContextRef);
	ClinicalContactShortVo clinicalContact = domain.getClinicalContact(clinicalContactRef);

	if (careContext == null)
	{
		contextInfo.append("No Care Context");
	}
	else
	{
		contextInfo.append("Care Context: ");
		contextInfo.append(careContext.toString());
	}

	if (clinicalContact == null)
	{
		contextInfo.append("<br>No Clinical Contact");
	}
	else
	{
		contextInfo.append("<br>Clinical Contact");
		contextInfo.append(clinicalContact.toString());
	}

	return contextInfo.toString();
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateGraphicalAssessmentSelection()
{
	if (form.getLocalContext().getLoadedRecords() == null)
		return;

	PatientAssessmentVo lastSelectedPatientAssessment = form.getLocalContext().getCurrentPatientAssessment();
	if (lastSelectedPatientAssessment == null)
	{
		CareContextRefVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
		ClinicalContactRefVo clinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
		PatientAssessmentListVoCollection records = form.getLocalContext().getLoadedRecords();

		for (int x = 0; x < records.size(); x++)
		{
			PatientAssessmentListVo record = records.get(x);

			if (record.getCareContext() != null && record.getCareContext().equals(careContext))
			{
				if (record.getClinicalContact() != null && record.getClinicalContact().equals(clinicalContact))
				{
					form.lyrMain().tabPageDetails().lyrICP().tabGraphicAssessment().recbrGraphicalAssessment().setValue(record);
					return;
				}
				else if (record.getClinicalContact() == null && clinicalContact == null)
				{
					form.lyrMain().tabPageDetails().lyrICP().tabGraphicAssessment().recbrGraphicalAssessment().setValue(record);
					return;
				}
			}
		}
	}
	else
	{
		form.lyrMain().tabPageDetails().lyrICP().tabGraphicAssessment().recbrGraphicalAssessment().setValue(lastSelectedPatientAssessment);
	}
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateStructuredAssessmentSelection()
{
	if (form.getLocalContext().getLoadedRecords() == null)
		return;

	PatientAssessmentVo lastSelectedPatientAssessment = form.getLocalContext().getCurrentPatientAssessment();
	if (lastSelectedPatientAssessment == null)
	{
		CareContextRefVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
		ClinicalContactRefVo clinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
		PatientAssessmentListVoCollection records = form.getLocalContext().getLoadedRecords();

		for (int x = 0; x < records.size(); x++)
		{
			PatientAssessmentListVo record = records.get(x);

			if (record.getCareContext() != null && record.getCareContext().equals(careContext))
			{
				if (record.getClinicalContact() != null && record.getClinicalContact().equals(clinicalContact))
				{
					form.lyrMain().tabPageDetails().lyrICP().tabAssessment().recbrStructuredAssessment().setValue(record);
					return;
				}
				else if (record.getClinicalContact() == null && clinicalContact == null)
				{
					form.lyrMain().tabPageDetails().lyrICP().tabAssessment().recbrStructuredAssessment().setValue(record);
					return;
				}
			}
		}
	}
	else
	{
		form.lyrMain().tabPageDetails().lyrICP().tabAssessment().recbrStructuredAssessment().setValue(lastSelectedPatientAssessment);
	}
}
 
Example 30
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 31
Project: AvoinApotti   File: PatientICPImpl.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentVo getPatientAssessment(ClinicalContactRefVo clinicalContact, GraphicAssessmentRefVo graphicAssessment)
{
	if(clinicalContact == null || clinicalContact.getID_ClinicalContact() == null)
		throw new CodingRuntimeException("Invalid clinical contact");
	if(graphicAssessment == null || graphicAssessment.getID_GraphicAssessment() == null)
		throw new CodingRuntimeException("Invalid graphical 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.graphic.id = :ga");
	markers.add("ga");
	values.add(graphicAssessment.getID_GraphicAssessment());
	
	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 32
Project: AvoinApotti   File: PatientICPActionLinkedDetailsComponentImpl.java   Source Code and License 5 votes vote down vote up
public ClinicalContactShortVo getClinicalContact(ClinicalContactRefVo clinicalContactRef)
{
	if (clinicalContactRef == null || !clinicalContactRef.getID_ClinicalContactIsNotNull())
		return null;
	
	return ClinicalContactShortVoAssembler.create((ClinicalContact) getDomainFactory().getDomainObject(ClinicalContact.class, clinicalContactRef.getID_ClinicalContact()));
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void browseRecord()
{
	clearFields();
	
	if(form.recbrWheelSkills().getValue() != null)
	{
		if(form.recbrWheelSkills().getValue() instanceof ClinicalContactShortVo)
		{
			populateScreenFromData(domain.getWheelchairSkillsByClinicalContact((ClinicalContactRefVo) form.recbrWheelSkills().getValue()));
		}
	}
	isRecordEditable();
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void browseRecord()
{
	clearScreen();
	prePopulateGrids();
	updateBrowseInformation();
	
	if(form.recbrPlinth().getValue() != null && form.recbrPlinth().getValue() instanceof ClinicalContactShortVo)
	{
		form.getLocalContext().setPlinthWork(domain.getPlinthWorkByClinicalContact((ClinicalContactRefVo) form.recbrPlinth().getValue()));
		populateScreen(form.getLocalContext().getPlinthWork());
	}
	isRecordEditable();
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void browseRecord()
{
	form.getLocalContext().setvoEnvironmentalVisit(null);
	clearScreen();
	if(form.recbrEnvironment().getValue() != null)
	{
		if(form.recbrEnvironment().getValue() instanceof ClinicalContactShortVo)
			form.getLocalContext().setvoEnvironmentalVisit(domain.getEnvironmentalVisitByClinicalContact((ClinicalContactRefVo) form.recbrEnvironment().getValue()));
		else if(form.recbrEnvironment().getValue() instanceof EnvironmentalVisitShortVo)
			form.getLocalContext().setvoEnvironmentalVisit(domain.getEnvironmentalVisit((EnvironmentalVisitShortVo) form.recbrEnvironment().getValue()));
	}
	populateScreenFromData();
	isRecordEditable();
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void browseRecord() 
{
	initialize();
	
	if(form.recbrStrengthProg().getValue() != null)
	{
		if(form.recbrStrengthProg().getValue() instanceof ClinicalContactShortVo)
		{
			populateScreenFromData(domain.getStrengthProgByClinicalContact((ClinicalContactRefVo) form.recbrStrengthProg().getValue()));
		}
	}
	isRecordEditable();
}
 
Example 37
Project: AvoinApotti   File: StrengtheningProgramImpl.java   Source Code and License 5 votes vote down vote up
public StrengtheningProgramVo getStrengthProgByClinicalContact(ClinicalContactRefVo voClinicalContactRefVo) 
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer(" ");
	String query = "from StrengtheningProgram sp ";
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	String andStr = " ";
	
	if (voClinicalContactRefVo != null)
	{
		hql.append(andStr + " sp.clinicalContact.id = :id_ClinicalContact");
		markers.add("id_ClinicalContact");
		values.add(voClinicalContactRefVo.getID_ClinicalContact());			
		andStr = " and ";
	}
	
	if (markers.size() > 0) query += " where ";
	query += hql.toString();
	

	List skills = factory.find(query, markers, values);	
	StrengtheningProgramVoCollection collStrengtheningProgramVo = StrengtheningProgramVoAssembler.createStrengtheningProgramVoCollectionFromStrengtheningProgram(skills);
	if(collStrengtheningProgramVo != null && collStrengtheningProgramVo.size() > 0)
		return collStrengtheningProgramVo.get(0);
	
	return null;
}
 
Example 38
Project: AvoinApotti   File: ThermalImpl.java   Source Code and License 5 votes vote down vote up
public ThermalVo getThermalDetailsByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
	if (voClinicalContactRef == null)
		throw new RuntimeException("Cannot get ThermalVo for null ClinicalContactRefVo");

	List list = Thermal.listThermalByClinicalContact(getDomainFactory(), (ims.core.admin.domain.objects.ClinicalContact) getDomainFactory().getDomainObject(voClinicalContactRef));

	if (list == null || list.size() == 0)
		return null;
	//	WDEV-13649else if (list.size() > 1)
	//	WDEV-13649	throw new CodingRuntimeException("More than one Thermal found for the current Clinical Contact");

	return ThermalVoAssembler.createThermalVoCollectionFromThermal(list).get(0);
}
 
Example 39
Project: AvoinApotti   File: GaitReEducationImpl.java   Source Code and License 5 votes vote down vote up
/**
 *	WDEV-13648
 *	List Gait Re-education records for a certain clinical contact
 */
public GaitReEducationVoCollection listGaitReEducation(ClinicalContactRefVo voClinicalContact)
{
	String query = "from GaitReEducation gr where gr.clinicalContact.id = :RCC";
	
	return GaitReEducationVoAssembler.createGaitReEducationVoCollectionFromGaitReEducation(getDomainFactory().find(query, "RCC", voClinicalContact.getID_ClinicalContact()));
}
 
Example 40
Project: AvoinApotti   File: PneumaticImpl.java   Source Code and License 5 votes vote down vote up
public ElectrotherapyPneumaticVo getElectrotheraphyPneumaticVoByClinicalContact(ClinicalContactRefVo voClinicalContactRef) 
{
	if(voClinicalContactRef == null)
		throw new CodingRuntimeException("ElectrotherapyPneumatic Filter not provided for get call. ");
	
	String hql = new String("from ElectrotherapyPneumatic p where p.clinicalContact.id = :CLINICAL_CONTACT_ID");

	java.util.List list = getDomainFactory().find(hql, "CLINICAL_CONTACT_ID", voClinicalContactRef.getID_ClinicalContact());

	ElectrotherapyPneumaticVoCollection coll = ElectrotherapyPneumaticVoAssembler.createElectrotherapyPneumaticVoCollectionFromElectrotherapyPneumatic(list);
	if(coll!=null && coll.size()>0)
		return coll.get(0);
	else
		return null;
}