Java Code Examples for ims.ocrr.configuration.domain.objects.Investigation

The following are top voted examples for showing how to use ims.ocrr.configuration.domain.objects.Investigation. 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: OcsIfInboundImpl.java   Source Code and License 6 votes vote down vote up
private LocSvcProviderSys getDomLocProviderSystem(IfProviderInvSearchVo searchCriteria)
{
	if (searchCriteria == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	ProviderSystem ps = ProviderSystem.getProviderSystemFromHl7Application(factory, searchCriteria.getHl7App());
	if (ps == null)
		return null;
	

	//Investigation domInv = this.getDomInvestigationByHl7AppInvAndService(factory, searchCriteria);
	Investigation domInv = this.getDomInvestigationByHl7AppServiceAndSource(factory, searchCriteria);
	
	if (domInv == null)
	{
		throw new DomainRuntimeException("Can't find Investigation for ProviderSystem = " + ps.getHl7Application() + " and inv code = " + searchCriteria.getProviderInvCode() + " and service = " + searchCriteria.getService().getServiceName());
	}
	return domInv.getProviderService();
}
 
Example 2
Project: AvoinApotti   File: SelectandOrderImpl.java   Source Code and License 6 votes vote down vote up
private boolean isInvestigationInBreachedList(Investigation inv, BreachedInvestigationsVoCollection breachedInvestigations) // 	WDEV-16762
{
	if(inv == null || breachedInvestigations == null)
		return false;
	
	Iterator<BreachedInvestigationsVo> list = breachedInvestigations.iterator();// 	WDEV-16762
	
	while(list.hasNext())
	{
		BreachedInvestigationsVo item = list.next();// 	WDEV-16762
		
		if(item == null || item.getInvestigationId() == null)
			continue;
		
		if(item.getInvestigationId().equals(inv.getId()))// 	WDEV-16762
			return true;
	}
	
	return false;
}
 
Example 3
Project: AvoinApotti   File: SelectandOrderImpl.java   Source Code and License 6 votes vote down vote up
private GenderInvestigationVo isInvAppropriate(GenderSpecific instGenderSpecific, boolean isFemale, Investigation doInv)
{
	if (instGenderSpecific != null)
	{
		if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE))
		{
			if (instGenderSpecific.equals(GenderSpecific.FEMALE))
			{
				if (!isFemale)
					return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762
			}
			else if (instGenderSpecific.equals(GenderSpecific.MALE))
			{
				if (isFemale)
					return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762
			}
		}
	}
	
	return null;
}
 
Example 4
Project: AvoinApotti   File: TestEditImpl.java   Source Code and License 6 votes vote down vote up
private void checkTemplatesAndProfiles(Integer idInvestigation, InvestigationIndexVo voInvestigationIndex, DomainFactory factory) throws DomainInterfaceException
{
	// a new investigation provider record
	if (idInvestigation == null)
		return;

	// get investigation provider from collection
	InvestigationShortVo voInv = null;
	for (int i = 0; i < voInvestigationIndex.getInvestigations().size(); i++)
	{
		if (voInvestigationIndex.getInvestigations().get(i).getID_InvestigationIsNotNull() && voInvestigationIndex.getInvestigations().get(i).getID_Investigation().equals(idInvestigation))
			voInv = voInvestigationIndex.getInvestigations().get(i);
	}

	if (voInv.getActiveStatusIsNotNull() && voInv.getActiveStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
	{
		Investigation doInvRecord = (Investigation) factory.getDomainObject(Investigation.class, voInv.getID_Investigation());
		if (doInvRecord.getActiveStatus().equals(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE)))
		{
			// check if this record is associated with an active
			// templates\profiles\ordersets
			List items = getAssociatedItems(factory, doInvRecord.getId());
			handleErrors(items);
		}
	}
}
 
Example 5
Project: openMAXIMS   File: OcsIfInboundImpl.java   Source Code and License 6 votes vote down vote up
private LocSvcProviderSys getDomLocProviderSystem(IfProviderInvSearchVo searchCriteria)
{
	if (searchCriteria == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	ProviderSystem ps = ProviderSystem.getProviderSystemFromHl7Application(factory, searchCriteria.getHl7App());
	if (ps == null)
		return null;
	

	//Investigation domInv = this.getDomInvestigationByHl7AppInvAndService(factory, searchCriteria);
	Investigation domInv = this.getDomInvestigationByHl7AppServiceAndSource(factory, searchCriteria);
	
	if (domInv == null)
	{
		throw new DomainRuntimeException("Can't find Investigation for ProviderSystem = " + ps.getHl7Application() + " and inv code = " + searchCriteria.getProviderInvCode() + " and service = " + searchCriteria.getService().getServiceName());
	}
	return domInv.getProviderService();
}
 
Example 6
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 6 votes vote down vote up
private boolean isInvestigationInBreachedList(Investigation inv, BreachedInvestigationsVoCollection breachedInvestigations) // 	WDEV-16762
{
	if(inv == null || breachedInvestigations == null)
		return false;
	
	Iterator<BreachedInvestigationsVo> list = breachedInvestigations.iterator();// 	WDEV-16762
	
	while(list.hasNext())
	{
		BreachedInvestigationsVo item = list.next();// 	WDEV-16762
		
		if(item == null || item.getInvestigationId() == null)
			continue;
		
		if(item.getInvestigationId().equals(inv.getId()))// 	WDEV-16762
			return true;
	}
	
	return false;
}
 
Example 7
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 6 votes vote down vote up
private GenderInvestigationVo isInvAppropriate(GenderSpecific instGenderSpecific, boolean isFemale, Investigation doInv)
{
	if (instGenderSpecific != null)
	{
		if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE))
		{
			if (instGenderSpecific.equals(GenderSpecific.FEMALE))
			{
				if (!isFemale)
					return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762
			}
			else if (instGenderSpecific.equals(GenderSpecific.MALE))
			{
				if (isFemale)
					return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762
			}
		}
	}
	
	return null;
}
 
Example 8
Project: openMAXIMS   File: TestEditImpl.java   Source Code and License 6 votes vote down vote up
private void checkTemplatesAndProfiles(Integer idInvestigation, InvestigationIndexVo voInvestigationIndex, DomainFactory factory) throws DomainInterfaceException
{
	// a new investigation provider record
	if (idInvestigation == null)
		return;

	// get investigation provider from collection
	InvestigationShortVo voInv = null;
	for (int i = 0; i < voInvestigationIndex.getInvestigations().size(); i++)
	{
		if (voInvestigationIndex.getInvestigations().get(i).getID_InvestigationIsNotNull() && voInvestigationIndex.getInvestigations().get(i).getID_Investigation().equals(idInvestigation))
			voInv = voInvestigationIndex.getInvestigations().get(i);
	}

	if (voInv.getActiveStatusIsNotNull() && voInv.getActiveStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
	{
		Investigation doInvRecord = (Investigation) factory.getDomainObject(Investigation.class, voInv.getID_Investigation());
		if (doInvRecord.getActiveStatus().equals(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE)))
		{
			// check if this record is associated with an active
			// templates\profiles\ordersets
			List items = getAssociatedItems(factory, doInvRecord.getId());
			handleErrors(items);
		}
	}
}
 
Example 9
Project: openMAXIMS   File: OcsIfInboundImpl.java   Source Code and License 6 votes vote down vote up
private LocSvcProviderSys getDomLocProviderSystem(IfProviderInvSearchVo searchCriteria)
{
	if (searchCriteria == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	ProviderSystem ps = ProviderSystem.getProviderSystemFromHl7Application(factory, searchCriteria.getHl7App());
	if (ps == null)
		return null;
	

	//Investigation domInv = this.getDomInvestigationByHl7AppInvAndService(factory, searchCriteria);
	Investigation domInv = this.getDomInvestigationByHl7AppServiceAndSource(factory, searchCriteria);
	
	if (domInv == null)
	{
		throw new DomainRuntimeException("Can't find Investigation for ProviderSystem = " + ps.getHl7Application() + " and inv code = " + searchCriteria.getProviderInvCode() + " and service = " + searchCriteria.getService().getServiceName());
	}
	return domInv.getProviderService();
}
 
Example 10
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 6 votes vote down vote up
private boolean isInvestigationInBreachedList(Investigation inv, BreachedInvestigationsVoCollection breachedInvestigations) // 	WDEV-16762
{
	if(inv == null || breachedInvestigations == null)
		return false;
	
	Iterator<BreachedInvestigationsVo> list = breachedInvestigations.iterator();// 	WDEV-16762
	
	while(list.hasNext())
	{
		BreachedInvestigationsVo item = list.next();// 	WDEV-16762
		
		if(item == null || item.getInvestigationId() == null)
			continue;
		
		if(item.getInvestigationId().equals(inv.getId()))// 	WDEV-16762
			return true;
	}
	
	return false;
}
 
Example 11
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 6 votes vote down vote up
private GenderInvestigationVo isInvAppropriate(GenderSpecific instGenderSpecific, boolean isFemale, Investigation doInv)
{
	if (instGenderSpecific != null)
	{
		if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE))
		{
			if (instGenderSpecific.equals(GenderSpecific.FEMALE))
			{
				if (!isFemale)
					return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762
			}
			else if (instGenderSpecific.equals(GenderSpecific.MALE))
			{
				if (isFemale)
					return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762
			}
		}
	}
	
	return null;
}
 
Example 12
Project: openMAXIMS   File: TestEditImpl.java   Source Code and License 6 votes vote down vote up
private void checkTemplatesAndProfiles(Integer idInvestigation, InvestigationIndexVo voInvestigationIndex, DomainFactory factory) throws DomainInterfaceException
{
	// a new investigation provider record
	if (idInvestigation == null)
		return;

	// get investigation provider from collection
	InvestigationShortVo voInv = null;
	for (int i = 0; i < voInvestigationIndex.getInvestigations().size(); i++)
	{
		if (voInvestigationIndex.getInvestigations().get(i).getID_InvestigationIsNotNull() && voInvestigationIndex.getInvestigations().get(i).getID_Investigation().equals(idInvestigation))
			voInv = voInvestigationIndex.getInvestigations().get(i);
	}

	if (voInv.getActiveStatusIsNotNull() && voInv.getActiveStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
	{
		Investigation doInvRecord = (Investigation) factory.getDomainObject(Investigation.class, voInv.getID_Investigation());
		if (doInvRecord.getActiveStatus().equals(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE)))
		{
			// check if this record is associated with an active
			// templates\profiles\ordersets
			List items = getAssociatedItems(factory, doInvRecord.getId());
			handleErrors(items);
		}
	}
}
 
Example 13
Project: openmaxims-linux   File: OcsIfInboundImpl.java   Source Code and License 6 votes vote down vote up
private LocSvcProviderSys getDomLocProviderSystem(IfProviderInvSearchVo searchCriteria)
{
	if (searchCriteria == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	ProviderSystem ps = ProviderSystem.getProviderSystemFromHl7Application(factory, searchCriteria.getHl7App());
	if (ps == null)
		return null;
	

	//Investigation domInv = this.getDomInvestigationByHl7AppInvAndService(factory, searchCriteria);
	Investigation domInv = this.getDomInvestigationByHl7AppServiceAndSource(factory, searchCriteria);
	
	if (domInv == null)
	{
		throw new DomainRuntimeException("Can't find Investigation for ProviderSystem = " + ps.getHl7Application() + " and inv code = " + searchCriteria.getProviderInvCode() + " and service = " + searchCriteria.getService().getServiceName());
	}
	return domInv.getProviderService();
}
 
Example 14
Project: openmaxims-linux   File: SelectandOrderImpl.java   Source Code and License 6 votes vote down vote up
private boolean isInvestigationInBreachedList(Investigation inv, BreachedInvestigationsVoCollection breachedInvestigations) // 	WDEV-16762
{
	if(inv == null || breachedInvestigations == null)
		return false;
	
	Iterator<BreachedInvestigationsVo> list = breachedInvestigations.iterator();// 	WDEV-16762
	
	while(list.hasNext())
	{
		BreachedInvestigationsVo item = list.next();// 	WDEV-16762
		
		if(item == null || item.getInvestigationId() == null)
			continue;
		
		if(item.getInvestigationId().equals(inv.getId()))// 	WDEV-16762
			return true;
	}
	
	return false;
}
 
Example 15
Project: openmaxims-linux   File: SelectandOrderImpl.java   Source Code and License 6 votes vote down vote up
private GenderInvestigationVo isInvAppropriate(GenderSpecific instGenderSpecific, boolean isFemale, Investigation doInv)
{
	if (instGenderSpecific != null)
	{
		if (!instGenderSpecific.equals(GenderSpecific.NOTAPPLICABLE))
		{
			if (instGenderSpecific.equals(GenderSpecific.FEMALE))
			{
				if (!isFemale)
					return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762
			}
			else if (instGenderSpecific.equals(GenderSpecific.MALE))
			{
				if (isFemale)
					return GenderInvestigationVoAssembler.create(doInv);//WDEV-16762
			}
		}
	}
	
	return null;
}
 
Example 16
Project: openmaxims-linux   File: TestEditImpl.java   Source Code and License 6 votes vote down vote up
private void checkTemplatesAndProfiles(Integer idInvestigation, InvestigationIndexVo voInvestigationIndex, DomainFactory factory) throws DomainInterfaceException
{
	// a new investigation provider record
	if (idInvestigation == null)
		return;

	// get investigation provider from collection
	InvestigationShortVo voInv = null;
	for (int i = 0; i < voInvestigationIndex.getInvestigations().size(); i++)
	{
		if (voInvestigationIndex.getInvestigations().get(i).getID_InvestigationIsNotNull() && voInvestigationIndex.getInvestigations().get(i).getID_Investigation().equals(idInvestigation))
			voInv = voInvestigationIndex.getInvestigations().get(i);
	}

	if (voInv.getActiveStatusIsNotNull() && voInv.getActiveStatus().equals(PreActiveActiveInactiveStatus.INACTIVE))
	{
		Investigation doInvRecord = (Investigation) factory.getDomainObject(Investigation.class, voInv.getID_Investigation());
		if (doInvRecord.getActiveStatus().equals(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE)))
		{
			// check if this record is associated with an active
			// templates\profiles\ordersets
			List items = getAssociatedItems(factory, doInvRecord.getId());
			handleErrors(items);
		}
	}
}
 
Example 17
Project: AvoinApotti   File: OcsIfInboundImpl.java   Source Code and License 5 votes vote down vote up
/**
 *  WDEV-16384
 *  Calculate the expected datetime of the result based on configured turnaround values
 */
public ims.framework.utils.DateTime calculateExpectedDateTime(ims.ocrr.configuration.vo.InvestigationRefVo investigation, ims.framework.utils.DateTime dateTimeReceived)
{
	DomainFactory factory = getDomainFactory();
	
	// First check if any configured turnaround date for the investigation
	Investigation domInv = (Investigation) factory.getDomainObject(Investigation.class, investigation.getID_Investigation());
	if (domInv != null)
	{
		// Configured value set to zero means that this investigation does not want expected values calculated
		if (domInv.getExpectedTurnaround() != null && domInv.getExpectedTurnaround() == 0)
			return null;
		
		if (domInv.getExpectedTurnaround() != null && domInv.getTurnaroundMeasure() != null)
		{
			return (calculateTurnaround(domInv.getExpectedTurnaround(), domInv.getTurnaroundMeasure(), dateTimeReceived));
		}
		
		// No configuration at investigation level, check the service level
		Service domService = domInv.getProviderService().getLocationService().getService();
		if (domService != null && domService.getExpectedTurnaround() != null && domService.getTurnaroundMeasure() != null)
		{
			return (calculateTurnaround(domService.getExpectedTurnaround(), domService.getTurnaroundMeasure(), dateTimeReceived));
		}
	}
	return null;
}
 
Example 18
Project: AvoinApotti   File: OcsIfImpl.java   Source Code and License 5 votes vote down vote up
public ProviderSystemVo getProviderSystem(InvestigationRefVo invVo)
{
	if (invVo == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	Investigation domInv = (Investigation)factory.getDomainObject(Investigation.class, invVo.getID_Investigation());
	return ProviderSystemVoAssembler.create(domInv.getProviderService().getProviderSystem());
}
 
Example 19
Project: AvoinApotti   File: OcsIfImpl.java   Source Code and License 5 votes vote down vote up
public ServiceShortVo getService(InvestigationRefVo invVo)
{
	if (invVo == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	Investigation domInv = (Investigation)factory.getDomainObject(Investigation.class, invVo.getID_Investigation());
	return ServiceShortVoAssembler.create(domInv.getProviderService().getLocationService().getService());
}
 
Example 20
Project: AvoinApotti   File: MyOrderImpl.java   Source Code and License 5 votes vote down vote up
public InvestigationUnderSpecimenVo getInvestigationUnderSpecimen(Integer idInvestigation)
{
	if (idInvestigation == null)
		throw new DomainRuntimeException("No id provided for getInvestigationUnderSpecimen");

	DomainFactory factory = getDomainFactory();
	return InvestigationUnderSpecimenVoAssembler.create((Investigation) factory.getDomainObject(Investigation.class, idInvestigation));
}
 
Example 21
Project: AvoinApotti   File: MyOrderImpl.java   Source Code and License 5 votes vote down vote up
public InvestigationHelpTextVo getInvestigationHelpText(Integer investigation) 
{
	if(investigation == null)
		return null;
	
	return InvestigationHelpTextVoAssembler.create((Investigation) getDomainFactory().getDomainObject(Investigation.class, investigation));
}
 
Example 22
Project: AvoinApotti   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public InvestigationQuestionShortVoCollection listInformatonMessagesForInvestigation(Integer investigationId, Integer parentId)//WDEV-16762
{
	if(investigationId == null)
		throw new CodingRuntimeException("investigationId is null in method listInformatonMessagesForInvestigation");
	
	DomainFactory factory = getDomainFactory();
	
	Investigation domInvest = (Investigation)factory.getDomainObject(Investigation.class, investigationId);
	if (domInvest == null)
		throw new DomainRuntimeException("No investigation found for id = " + investigationId);
			
	List infoQuestions = new ArrayList();
	Iterator it = domInvest.getAssocQuestions().iterator();
	while(it.hasNext())
	{
		InvestigationQuestion invQuest = (InvestigationQuestion)it.next();
		if(!invQuest.getQuestion().isIsQuestion().booleanValue())
			infoQuestions.add(invQuest);
	}
	
	InvestigationQuestionShortVoCollection voCollInvQuestions = InvestigationQuestionShortVoAssembler.createInvestigationQuestionShortVoCollectionFromInvestigationQuestion(infoQuestions);
	for(int i=0;i<voCollInvQuestions.size();i++)
	{
		if(domInvest.getInvestigationIndex() != null)
		{
			voCollInvQuestions.get(i).setInvestigationName(domInvest.getInvestigationIndex().getName());
			voCollInvQuestions.get(i).setInvestigaionId(investigationId);//WDEV-16762
			voCollInvQuestions.get(i).setParentId(parentId);// 	WDEV-16762
		}
	}
	
	return voCollInvQuestions;
}
 
Example 23
Project: AvoinApotti   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public ReOrderPeriodMessageVoCollection listOrderSetInvestigationsWithinMinReOrderPeriod(OrderSetRefVo orderSet, PatientShort patient, BreachedInvestigationsVoCollection breachedInvestigations) // 	WDEV-16762
{
	if(orderSet == null || patient == null)
		throw new CodingRuntimeException("orderSet or patient is null in method listOrderSetInvestigationsWithinMinReOrderPeriod");
	
	boolean isFemale = patient.getSexIsNotNull() && patient.getSex().equals(Sex.FEMALE);
	
	DomainFactory factory = getDomainFactory();
	OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet);
	
	if(doOrderSet == null || doOrderSet.getComponent() == null)
		return null;
	
	Iterator it = doOrderSet.getComponent().iterator();
	
	ReOrderPeriodMessageVoCollection voCollMessages = new ReOrderPeriodMessageVoCollection();
	
	while(it.hasNext())
	{
		Object comp = it.next();
		if(!(comp instanceof OrderSetComponent))
			continue;
		
		Investigation doInv = ((OrderSetComponent) comp).getInvestigation();
		
		ReOrderPeriodMessageVoCollection profOrderInvMessages = listMessages(doInv, patient, isFemale, breachedInvestigations, null);//WDEV-16762
		
		if(profOrderInvMessages != null)
		{
			for(ReOrderPeriodMessageVo item : profOrderInvMessages)
				voCollMessages.add(item);
		}
	}
	
	return voCollMessages;
}
 
Example 24
Project: AvoinApotti   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public GenderInvestigationVoCollection listOrderSetInvestigationsWithGenderMessages(OrderSetRefVo orderSet, Boolean isFemale) 
{
	if(orderSet == null)
		throw new CodingRuntimeException("orderSet is null in method listOrderSetInvestigationsWithGenderMessages.");
	
	boolean female = Boolean.TRUE.equals(isFemale);
	
	DomainFactory factory = getDomainFactory();
	OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet);
	
	if(doOrderSet == null || doOrderSet.getComponent() == null)
		return null;
	
	Iterator it = doOrderSet.getComponent().iterator();
	GenderInvestigationVoCollection list = new GenderInvestigationVoCollection();//WDEV-16762
	
	while(it.hasNext())
	{
		Object comp = it.next();
		if(!(comp instanceof OrderSetComponent))
			continue;
		
		Investigation doInv = ((OrderSetComponent) comp).getInvestigation();
		
		GenderInvestigationVoCollection invGenderMessages = listGenderMessages(doInv, female, null);//WDEV-16762
		
		if(invGenderMessages != null)
		{
			for(GenderInvestigationVo item : invGenderMessages)//WDEV-16762
				list.add(item);
		}
	}
	
	return list;
}
 
Example 25
Project: AvoinApotti   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public InvestigationQuestionShortVoCollection listInformatonMessagesForOrderSet(OrderSetRefVo orderSet) 
{
	if(orderSet == null)
		throw new CodingRuntimeException("orderSet is null in method listInformatonMessagesForOrderSet.");
	
	DomainFactory factory = getDomainFactory();
	OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet);
	
	if(doOrderSet == null || doOrderSet.getComponent() == null)
		return null;
	
	Iterator it = doOrderSet.getComponent().iterator();
	InvestigationQuestionShortVoCollection list = new InvestigationQuestionShortVoCollection();
	
	while(it.hasNext())
	{
		Object comp = it.next();
		if(!(comp instanceof OrderSetComponent))
			continue;
		
		Investigation doInv = ((OrderSetComponent) comp).getInvestigation();
		
		InvestigationQuestionShortVoCollection infoMessages = listInfoMessages(doInv, null);//WDEV-16762
		
		if(infoMessages != null)
		{
			for(InvestigationQuestionShortVo item : infoMessages)
				list.add(item);
		}
	}
	
	return list;
}
 
Example 26
Project: AvoinApotti   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
private InvestigationQuestionShortVoCollection listInfoMessages(Investigation doInv, Integer parentId) //WDEV-16762
{
	if(doInv == null)
		return null;
	
	if(Boolean.TRUE.equals(doInv.getInvestigationIndex().isIsProfile()))
	{
		InvestigationQuestionShortVoCollection infoQuestions = new InvestigationQuestionShortVoCollection();
		
		if(doInv.getAssocInvestigations() != null)
		{
			Iterator it = doInv.getAssocInvestigations().iterator();
			
			while(it.hasNext())
			{
				Object comp = it.next();
				
				if(!(comp instanceof Investigation))
					continue;
				
				addInfoQuestionsCollection(infoQuestions, listInfoMessages((Investigation)comp, doInv.getId()));//WDEV-16762
			}
			
			return infoQuestions;
		}
	}
	
	return listInformatonMessagesForInvestigation(doInv.getId(), parentId);//WDEV-16762
}
 
Example 27
Project: AvoinApotti   File: BookAppointmentImpl.java   Source Code and License 5 votes vote down vote up
private Set createOrderInvestigations(List invs, Booking_Appointment doNewAppt, OcsOrderSession doOcsOrder)
{
	Set orderInvs = new HashSet();
	Iterator it = invs.iterator();
	while (it.hasNext())
	{
		Investigation doInv = (Investigation) it.next();
		OrderInvestigation doOrderInv = new OrderInvestigation();
		doOrderInv.setInvestigation(doInv);
		doOrderInv.setAppointmentDate(doNewAppt != null ? doNewAppt.getAppointmentDate() : null);
		doOrderInv.setOrderDetails(doOcsOrder);

		OrderedInvestigationStatus status = new OrderedInvestigationStatus();
		status.setOrdInvStatus(getDomLookup(OrderInvStatus.ORDERED));
		status.setChangeDateTime(new java.util.Date());
		status.setProcessedDateTime(new java.util.Date());
		status.setChangeUser("ICAB");
		doOrderInv.setOrdInvCurrentStatus(status);
		doOrderInv.getOrdInvStatusHistory().add(status);

		doOrderInv.setWasOrdered(true);
		doOrderInv.setDisplayDateTime(new DateTime().getJavaDate());
		doOrderInv.setDisplayTimeSupplied(true);
		doOrderInv.setDisplayFlag(getDomLookup(OcsDisplayFlag.REQUESTED));
		doOrderInv.setOrdInvSeq(new Integer(0));
		doOrderInv.setWasProcessed(false);

		orderInvs.add(doOrderInv);
	}

	return orderInvs;
}
 
Example 28
Project: openMAXIMS   File: OcsIfInboundImpl.java   Source Code and License 5 votes vote down vote up
/**
 *  WDEV-16384
 *  Calculate the expected datetime of the result based on configured turnaround values
 */
public ims.framework.utils.DateTime calculateExpectedDateTime(ims.ocrr.configuration.vo.InvestigationRefVo investigation, ims.framework.utils.DateTime dateTimeReceived)
{
	DomainFactory factory = getDomainFactory();
	
	// First check if any configured turnaround date for the investigation
	Investigation domInv = (Investigation) factory.getDomainObject(Investigation.class, investigation.getID_Investigation());
	if (domInv != null)
	{
		// Configured value set to zero means that this investigation does not want expected values calculated
		if (domInv.getExpectedTurnaround() != null && domInv.getExpectedTurnaround() == 0)
			return null;
		
		if (domInv.getExpectedTurnaround() != null && domInv.getTurnaroundMeasure() != null)
		{
			return (calculateTurnaround(domInv.getExpectedTurnaround(), domInv.getTurnaroundMeasure(), dateTimeReceived));
		}
		
		// No configuration at investigation level, check the service level
		Service domService = domInv.getProviderService().getLocationService().getService();
		if (domService != null && domService.getExpectedTurnaround() != null && domService.getTurnaroundMeasure() != null)
		{
			return (calculateTurnaround(domService.getExpectedTurnaround(), domService.getTurnaroundMeasure(), dateTimeReceived));
		}
	}
	return null;
}
 
Example 29
Project: openMAXIMS   File: OcsIfImpl.java   Source Code and License 5 votes vote down vote up
public ProviderSystemVo getProviderSystem(InvestigationRefVo invVo)
{
	if (invVo == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	Investigation domInv = (Investigation)factory.getDomainObject(Investigation.class, invVo.getID_Investigation());
	return ProviderSystemVoAssembler.create(domInv.getProviderService().getProviderSystem());
}
 
Example 30
Project: openMAXIMS   File: OcsIfImpl.java   Source Code and License 5 votes vote down vote up
public ServiceShortVo getService(InvestigationRefVo invVo)
{
	if (invVo == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	Investigation domInv = (Investigation)factory.getDomainObject(Investigation.class, invVo.getID_Investigation());
	return ServiceShortVoAssembler.create(domInv.getProviderService().getLocationService().getService());
}
 
Example 31
Project: openMAXIMS   File: AppointmentOutcomeDialogImpl.java   Source Code and License 5 votes vote down vote up
private Set createOrderInvestigations(List invs, Booking_Appointment doNewAppt, OcsOrderSession doOcsOrder)
{
	Set orderInvs = new HashSet();
	Iterator it = invs.iterator();
	while (it.hasNext())
	{
		Investigation doInv = (Investigation) it.next();
		OrderInvestigation doOrderInv = new OrderInvestigation();
		doOrderInv.setInvestigation(doInv);
		doOrderInv.setAppointmentDate(doNewAppt != null ? doNewAppt.getAppointmentDate() : null);
		doOrderInv.setOrderDetails(doOcsOrder);

		OrderedInvestigationStatus status = new OrderedInvestigationStatus();
		status.setOrdInvStatus(getDomLookup(OrderInvStatus.ORDERED));
		status.setChangeDateTime(new java.util.Date());
		status.setProcessedDateTime(new java.util.Date());
		status.setChangeUser("ICAB");
		doOrderInv.setOrdInvCurrentStatus(status);
		doOrderInv.getOrdInvStatusHistory().add(status);

		doOrderInv.setWasOrdered(true);
		doOrderInv.setDisplayDateTime(new DateTime().getJavaDate());
		doOrderInv.setDisplayTimeSupplied(true);
		doOrderInv.setDisplayFlag(getDomLookup(OcsDisplayFlag.REQUESTED));
		doOrderInv.setOrdInvSeq(new Integer(0));
		doOrderInv.setWasProcessed(false);

		orderInvs.add(doOrderInv);
	}

	return orderInvs;
}
 
Example 32
Project: openMAXIMS   File: MyOrderImpl.java   Source Code and License 5 votes vote down vote up
public InvestigationUnderSpecimenVo getInvestigationUnderSpecimen(Integer idInvestigation)
{
	if (idInvestigation == null)
		throw new DomainRuntimeException("No id provided for getInvestigationUnderSpecimen");

	DomainFactory factory = getDomainFactory();
	return InvestigationUnderSpecimenVoAssembler.create((Investigation) factory.getDomainObject(Investigation.class, idInvestigation));
}
 
Example 33
Project: openMAXIMS   File: MyOrderImpl.java   Source Code and License 5 votes vote down vote up
public InvestigationHelpTextVo getInvestigationHelpText(Integer investigation) 
{
	if(investigation == null)
		return null;
	
	return InvestigationHelpTextVoAssembler.create((Investigation) getDomainFactory().getDomainObject(Investigation.class, investigation));
}
 
Example 34
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public InvestigationQuestionShortVoCollection listInformatonMessagesForInvestigation(Integer investigationId, Integer parentId)//WDEV-16762
{
	if(investigationId == null)
		throw new CodingRuntimeException("investigationId is null in method listInformatonMessagesForInvestigation");
	
	DomainFactory factory = getDomainFactory();
	
	Investigation domInvest = (Investigation)factory.getDomainObject(Investigation.class, investigationId);
	if (domInvest == null)
		throw new DomainRuntimeException("No investigation found for id = " + investigationId);
			
	List infoQuestions = new ArrayList();
	Iterator it = domInvest.getAssocQuestions().iterator();
	while(it.hasNext())
	{
		InvestigationQuestion invQuest = (InvestigationQuestion)it.next();
		if(!invQuest.getQuestion().isIsQuestion().booleanValue())
			infoQuestions.add(invQuest);
	}
	
	InvestigationQuestionShortVoCollection voCollInvQuestions = InvestigationQuestionShortVoAssembler.createInvestigationQuestionShortVoCollectionFromInvestigationQuestion(infoQuestions);
	for(int i=0;i<voCollInvQuestions.size();i++)
	{
		if(domInvest.getInvestigationIndex() != null)
		{
			voCollInvQuestions.get(i).setInvestigationName(domInvest.getInvestigationIndex().getName());
			voCollInvQuestions.get(i).setInvestigaionId(investigationId);//WDEV-16762
			voCollInvQuestions.get(i).setParentId(parentId);// 	WDEV-16762
		}
	}
	
	return voCollInvQuestions;
}
 
Example 35
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public ReOrderPeriodMessageVoCollection listOrderSetInvestigationsWithinMinReOrderPeriod(OrderSetRefVo orderSet, PatientShort patient, BreachedInvestigationsVoCollection breachedInvestigations) // 	WDEV-16762
{
	if(orderSet == null || patient == null)
		throw new CodingRuntimeException("orderSet or patient is null in method listOrderSetInvestigationsWithinMinReOrderPeriod");
	
	boolean isFemale = patient.getSexIsNotNull() && patient.getSex().equals(Sex.FEMALE);
	
	DomainFactory factory = getDomainFactory();
	OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet);
	
	if(doOrderSet == null || doOrderSet.getComponent() == null)
		return null;
	
	Iterator it = doOrderSet.getComponent().iterator();
	
	ReOrderPeriodMessageVoCollection voCollMessages = new ReOrderPeriodMessageVoCollection();
	
	while(it.hasNext())
	{
		Object comp = it.next();
		if(!(comp instanceof OrderSetComponent))
			continue;
		
		Investigation doInv = ((OrderSetComponent) comp).getInvestigation();
		
		ReOrderPeriodMessageVoCollection profOrderInvMessages = listMessages(doInv, patient, isFemale, breachedInvestigations, null);//WDEV-16762
		
		if(profOrderInvMessages != null)
		{
			for(ReOrderPeriodMessageVo item : profOrderInvMessages)
				voCollMessages.add(item);
		}
	}
	
	return voCollMessages;
}
 
Example 36
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public GenderInvestigationVoCollection listOrderSetInvestigationsWithGenderMessages(OrderSetRefVo orderSet, Boolean isFemale) 
{
	if(orderSet == null)
		throw new CodingRuntimeException("orderSet is null in method listOrderSetInvestigationsWithGenderMessages.");
	
	boolean female = Boolean.TRUE.equals(isFemale);
	
	DomainFactory factory = getDomainFactory();
	OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet);
	
	if(doOrderSet == null || doOrderSet.getComponent() == null)
		return null;
	
	Iterator it = doOrderSet.getComponent().iterator();
	GenderInvestigationVoCollection list = new GenderInvestigationVoCollection();//WDEV-16762
	
	while(it.hasNext())
	{
		Object comp = it.next();
		if(!(comp instanceof OrderSetComponent))
			continue;
		
		Investigation doInv = ((OrderSetComponent) comp).getInvestigation();
		
		GenderInvestigationVoCollection invGenderMessages = listGenderMessages(doInv, female, null);//WDEV-16762
		
		if(invGenderMessages != null)
		{
			for(GenderInvestigationVo item : invGenderMessages)//WDEV-16762
				list.add(item);
		}
	}
	
	return list;
}
 
Example 37
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public InvestigationQuestionShortVoCollection listInformatonMessagesForOrderSet(OrderSetRefVo orderSet) 
{
	if(orderSet == null)
		throw new CodingRuntimeException("orderSet is null in method listInformatonMessagesForOrderSet.");
	
	DomainFactory factory = getDomainFactory();
	OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet);
	
	if(doOrderSet == null || doOrderSet.getComponent() == null)
		return null;
	
	Iterator it = doOrderSet.getComponent().iterator();
	InvestigationQuestionShortVoCollection list = new InvestigationQuestionShortVoCollection();
	
	while(it.hasNext())
	{
		Object comp = it.next();
		if(!(comp instanceof OrderSetComponent))
			continue;
		
		Investigation doInv = ((OrderSetComponent) comp).getInvestigation();
		
		InvestigationQuestionShortVoCollection infoMessages = listInfoMessages(doInv, null);//WDEV-16762
		
		if(infoMessages != null)
		{
			for(InvestigationQuestionShortVo item : infoMessages)
				list.add(item);
		}
	}
	
	return list;
}
 
Example 38
Project: openMAXIMS   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
private InvestigationQuestionShortVoCollection listInfoMessages(Investigation doInv, Integer parentId) //WDEV-16762
{
	if(doInv == null)
		return null;
	
	if(Boolean.TRUE.equals(doInv.getInvestigationIndex().isIsProfile()))
	{
		InvestigationQuestionShortVoCollection infoQuestions = new InvestigationQuestionShortVoCollection();
		
		if(doInv.getAssocInvestigations() != null)
		{
			Iterator it = doInv.getAssocInvestigations().iterator();
			
			while(it.hasNext())
			{
				Object comp = it.next();
				
				if(!(comp instanceof Investigation))
					continue;
				
				addInfoQuestionsCollection(infoQuestions, listInfoMessages((Investigation)comp, doInv.getId()));//WDEV-16762
			}
			
			return infoQuestions;
		}
	}
	
	return listInformatonMessagesForInvestigation(doInv.getId(), parentId);//WDEV-16762
}
 
Example 39
Project: openMAXIMS   File: BookAppointmentImpl.java   Source Code and License 5 votes vote down vote up
private Set createOrderInvestigations(List invs, Booking_Appointment doNewAppt, OcsOrderSession doOcsOrder)
{
	Set orderInvs = new HashSet();
	Iterator it = invs.iterator();
	while (it.hasNext())
	{
		Investigation doInv = (Investigation) it.next();
		OrderInvestigation doOrderInv = new OrderInvestigation();
		doOrderInv.setInvestigation(doInv);
		doOrderInv.setAppointmentDate(doNewAppt != null ? doNewAppt.getAppointmentDate() : null);
		doOrderInv.setOrderDetails(doOcsOrder);

		OrderedInvestigationStatus status = new OrderedInvestigationStatus();
		status.setOrdInvStatus(getDomLookup(OrderInvStatus.ORDERED));
		status.setChangeDateTime(new java.util.Date());
		status.setProcessedDateTime(new java.util.Date());
		status.setChangeUser("ICAB");
		doOrderInv.setOrdInvCurrentStatus(status);
		doOrderInv.getOrdInvStatusHistory().add(status);

		doOrderInv.setWasOrdered(true);
		doOrderInv.setDisplayDateTime(new DateTime().getJavaDate());
		doOrderInv.setDisplayTimeSupplied(true);
		doOrderInv.setDisplayFlag(getDomLookup(OcsDisplayFlag.REQUESTED));
		doOrderInv.setOrdInvSeq(new Integer(0));
		doOrderInv.setWasProcessed(false);

		orderInvs.add(doOrderInv);
	}

	return orderInvs;
}
 
Example 40
Project: openMAXIMS   File: OcsIfInboundImpl.java   Source Code and License 5 votes vote down vote up
/**
 *  WDEV-16384
 *  Calculate the expected datetime of the result based on configured turnaround values
 */
public ims.framework.utils.DateTime calculateExpectedDateTime(ims.ocrr.configuration.vo.InvestigationRefVo investigation, ims.framework.utils.DateTime dateTimeReceived)
{
	DomainFactory factory = getDomainFactory();
	
	// First check if any configured turnaround date for the investigation
	Investigation domInv = (Investigation) factory.getDomainObject(Investigation.class, investigation.getID_Investigation());
	if (domInv != null)
	{
		// Configured value set to zero means that this investigation does not want expected values calculated
		if (domInv.getExpectedTurnaround() != null && domInv.getExpectedTurnaround() == 0)
			return null;
		
		if (domInv.getExpectedTurnaround() != null && domInv.getTurnaroundMeasure() != null)
		{
			return (calculateTurnaround(domInv.getExpectedTurnaround(), domInv.getTurnaroundMeasure(), dateTimeReceived));
		}
		
		// No configuration at investigation level, check the service level
		Service domService = domInv.getProviderService().getLocationService().getService();
		if (domService != null && domService.getExpectedTurnaround() != null && domService.getTurnaroundMeasure() != null)
		{
			return (calculateTurnaround(domService.getExpectedTurnaround(), domService.getTurnaroundMeasure(), dateTimeReceived));
		}
	}
	return null;
}