Java Code Examples for ims.pathways.vo.EventVo

The following are top voted examples for showing how to use ims.pathways.vo.EventVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	if((form.getLocalContext().getEditedRecordIsNotNull() &&
			form.getGlobalContext().Pathway.getSelectedEventLiteVoIsNotNull()) ||
				(form.getGlobalContext().Pathway.getSelectedEventLiteVoIsNotNull()))
	{
		EventVo event = domain.getEvent(form.getGlobalContext().Pathway.getSelectedEventLiteVo());
		form.getLocalContext().setEditedRecord(event);
		populateScreenFromData(event);
		updateContextMenuState();
	}
	else
	{
		clearAll();
		initialiseEventTargetManagementDynamicGrid();
	}
	
	form.setMode(FormMode.VIEW);
}
 
Example 2
Project: AvoinApotti   File: EventConfigurationImpl.java   View source code 6 votes vote down vote up
private void saveTargets(EventVo event,
			EventTargetVoCollection eventTargets, DomainFactory factory)
				throws ForeignKeyViolationException, StaleObjectException,
					UniqueKeyViolationException 
{
	if (eventTargets != null)
	{
		try
		{
			saveTargetEvents(event, factory, eventTargets);
		}
		catch (UnqViolationUncheckedException e)
		{
			throw new UniqueKeyViolationException("Event Target Management must be unique!");
		}
	}
}
 
Example 3
Project: AvoinApotti   File: EventConfigurationImpl.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked") private EventVoCollection checkForUniqEvent(EventVo record)
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer();
	ArrayList<String> names = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	hql.append("select event from Event as event left join event.status as status where event.name = :name and status.id = :id_status ");
	names.add("name");
	names.add("id_status");
	values.add(record.getName());
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getID());

	if (record.getID_EventIsNotNull())
	{
		hql.append(" and event.id <> :id  ");
		names.add("id");
		values.add(record.getID_Event());
	}

	List collection = factory.find(hql.toString(), names, values);
	return EventVoAssembler.createEventVoCollectionFromEvent(collection);
}
 
Example 4
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	if((form.getLocalContext().getEditedRecordIsNotNull() &&
			form.getGlobalContext().Pathway.getSelectedEventLiteVoIsNotNull()) ||
				(form.getGlobalContext().Pathway.getSelectedEventLiteVoIsNotNull()))
	{
		EventVo event = domain.getEvent(form.getGlobalContext().Pathway.getSelectedEventLiteVo());
		form.getLocalContext().setEditedRecord(event);
		populateScreenFromData(event);
		updateContextMenuState();
	}
	else
	{
		clearAll();
		initialiseEventTargetManagementDynamicGrid();
	}
	
	form.setMode(FormMode.VIEW);
}
 
Example 5
Project: openMAXIMS   File: EventConfigurationImpl.java   View source code 6 votes vote down vote up
private void saveTargets(EventVo event,
			EventTargetVoCollection eventTargets, DomainFactory factory)
				throws ForeignKeyViolationException, StaleObjectException,
					UniqueKeyViolationException 
{
	if (eventTargets != null)
	{
		try
		{
			saveTargetEvents(event, factory, eventTargets);
		}
		catch (UnqViolationUncheckedException e)
		{
			throw new UniqueKeyViolationException("Event Target Management must be unique!");
		}
	}
}
 
Example 6
Project: openMAXIMS   File: EventConfigurationImpl.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked") private EventVoCollection checkForUniqEvent(EventVo record)
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer();
	ArrayList<String> names = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	hql.append("select event from Event as event left join event.status as status where event.name = :name and status.id = :id_status ");
	names.add("name");
	names.add("id_status");
	values.add(record.getName());
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getID());

	if (record.getID_EventIsNotNull())
	{
		hql.append(" and event.id <> :id  ");
		names.add("id");
		values.add(record.getID_Event());
	}

	List collection = factory.find(hql.toString(), names, values);
	return EventVoAssembler.createEventVoCollectionFromEvent(collection);
}
 
Example 7
Project: openMAXIMS   File: ReferralDetailsImpl.java   View source code 6 votes vote down vote up
private EventVo checkIfAPatientEventIsEndsPathways(PatientEventVoCollection patientEventCollection)
{
	if(patientEventCollection == null || patientEventCollection.size() == 0)
		return null;
	
	String patientEventIds = getPatientEventIds(patientEventCollection);
	
	if(patientEventIds == null)
		return null;
	
	DomainFactory fatory = getDomainFactory();
	String query = "select ev from PatientEvent as pe left join pe.event as ev where pe.id in (" + patientEventIds + ") and ev.endsPathway = 1 ";
	
	List eventsLis = fatory.find(query);
	
	if(eventsLis != null && eventsLis.size() > 0)
	{
		return EventVoAssembler.create((Event) eventsLis.get(0));
	}
	
	return null;
}
 
Example 8
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	if((form.getLocalContext().getEditedRecordIsNotNull() &&
			form.getGlobalContext().Pathway.getSelectedEventLiteVoIsNotNull()) ||
				(form.getGlobalContext().Pathway.getSelectedEventLiteVoIsNotNull()))
	{
		EventVo event = domain.getEvent(form.getGlobalContext().Pathway.getSelectedEventLiteVo());
		form.getLocalContext().setEditedRecord(event);
		populateScreenFromData(event);
		updateContextMenuState();
	}
	else
	{
		clearAll();
		initialiseEventTargetManagementDynamicGrid();
	}
	
	form.setMode(FormMode.VIEW);
}
 
Example 9
Project: openMAXIMS   File: EventConfigurationImpl.java   View source code 6 votes vote down vote up
private void saveTargets(EventVo event,
			EventTargetVoCollection eventTargets, DomainFactory factory)
				throws ForeignKeyViolationException, StaleObjectException,
					UniqueKeyViolationException 
{
	if (eventTargets != null)
	{
		try
		{
			saveTargetEvents(event, factory, eventTargets);
		}
		catch (UnqViolationUncheckedException e)
		{
			throw new UniqueKeyViolationException("Event Target Management must be unique!");
		}
	}
}
 
Example 10
Project: openMAXIMS   File: EventConfigurationImpl.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked") private EventVoCollection checkForUniqEvent(EventVo record)
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer();
	ArrayList<String> names = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	hql.append("select event from Event as event left join event.status as status where event.name = :name and status.id = :id_status ");
	names.add("name");
	names.add("id_status");
	values.add(record.getName());
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getID());

	if (record.getID_EventIsNotNull())
	{
		hql.append(" and event.id <> :id  ");
		names.add("id");
		values.add(record.getID_Event());
	}

	List collection = factory.find(hql.toString(), names, values);
	return EventVoAssembler.createEventVoCollectionFromEvent(collection);
}
 
Example 11
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	if((form.getLocalContext().getEditedRecordIsNotNull() &&
			form.getGlobalContext().Pathway.getSelectedEventLiteVoIsNotNull()) ||
				(form.getGlobalContext().Pathway.getSelectedEventLiteVoIsNotNull()))
	{
		EventVo event = domain.getEvent(form.getGlobalContext().Pathway.getSelectedEventLiteVo());
		form.getLocalContext().setEditedRecord(event);
		populateScreenFromData(event);
		updateContextMenuState();
	}
	else
	{
		clearAll();
		initialiseEventTargetManagementDynamicGrid();
	}
	
	form.setMode(FormMode.VIEW);
}
 
Example 12
Project: openmaxims-linux   File: EventConfigurationImpl.java   View source code 6 votes vote down vote up
private void saveTargets(EventVo event,
			EventTargetVoCollection eventTargets, DomainFactory factory)
				throws ForeignKeyViolationException, StaleObjectException,
					UniqueKeyViolationException 
{
	if (eventTargets != null)
	{
		try
		{
			saveTargetEvents(event, factory, eventTargets);
		}
		catch (UnqViolationUncheckedException e)
		{
			throw new UniqueKeyViolationException("Event Target Management must be unique!");
		}
	}
}
 
Example 13
Project: openmaxims-linux   File: EventConfigurationImpl.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked") private EventVoCollection checkForUniqEvent(EventVo record)
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer();
	ArrayList<String> names = new ArrayList<String>();
	ArrayList<Serializable> values = new ArrayList<Serializable>();

	hql.append("select event from Event as event left join event.status as status where event.name = :name and status.id = :id_status ");
	names.add("name");
	names.add("id_status");
	values.add(record.getName());
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getID());

	if (record.getID_EventIsNotNull())
	{
		hql.append(" and event.id <> :id  ");
		names.add("id");
		values.add(record.getID_Event());
	}

	List collection = factory.find(hql.toString(), names, values);
	return EventVoAssembler.createEventVoCollectionFromEvent(collection);
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateScreenFromData(EventVo editedRecord) 
{
	if (editedRecord != null)
	{
		form.txtName().setValue(editedRecord.getName());
		form.txtDesc().setValue(editedRecord.getDescription());
	
		if (editedRecord.getIcon() != null)
		{
			form.qmbImage().newRow(editedRecord.getIcon(), editedRecord.getIcon().getImagePath(), engine.getRegisteredImage(editedRecord.getIcon().getImageId()));	
			form.qmbImage().setValue(editedRecord.getIcon());
		}
	
		form.cmbStatus().newRow(editedRecord.getStatus(), editedRecord.getStatus().getText());
		form.cmbStatus().setValue(editedRecord.getStatus());
		
		form.cmbEventType().setValue(editedRecord.getEventType());
	
		form.customControlMappings().setValue(editedRecord.getTaxonomyMaps());
		form.chkDisplayInPatientDiary().setValue(editedRecord.getPatientDiaryImpactIsNotNull() ? editedRecord.getPatientDiaryImpact() : false);
		form.chkStartsClock().setValue(editedRecord.getStartsClockIsNotNull() ? editedRecord.getStartsClock() : false);
		form.chkStopClocks().setValue(editedRecord.getStopsClockIsNotNull() ? editedRecord.getStopsClock() : false);
		form.chkEndsPathway().setValue(editedRecord.getEndsPathwayIsNotNull() ? editedRecord.getEndsPathway() : false);			
		form.chkScheduleEvent().setValue(editedRecord.getIsManualScheduledEventIsNotNull() ? editedRecord.getIsManualScheduledEvent() : false);	
	}

	updateChkScheduleControlState();
	populateExternalEventMappingsGrid(editedRecord);
	populateRTTEventGrid(editedRecord);
	populateEventTargetDinamicGrid(editedRecord);
	populateRolesGrid(editedRecord);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private EventExternalEventMappingVo populateEventExternalEventMapping(EventVo event, ExternalEventMappingVo mapping) 
{
	EventExternalEventMappingVo vo = new EventExternalEventMappingVo();
	vo.setEvent(event);
	vo.setExternalEventMapping(mapping);	
	vo.setStatus(form.cmbStatus().getValue());
	return vo;
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private EventRTTEventVo populateEventRTTEvent(EventVo event, RTTEventVo rtt) 
{
	EventRTTEventVo vo = new EventRTTEventVo();
	vo.setEvent(event);
	vo.setRTTEvent(rtt);
	vo.setStatus(form.cmbStatus().getValue());
	return vo;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateRolesGrid(EventVo event) 
{
	form.lyrTargets().tabActioningRoles().grdRoles().getRows().clear();
	
	AppRoleShortVoCollection voColl = domain.listRoles();
	if (voColl == null)
		return;
	
	form.lyrTargets().tabActioningRoles().grdRoles().getRows().clear();
	for (int i = 0; i < voColl.size(); i++)
	{
		AppRoleShortVo voAppRole = voColl.get(i);
		if(voAppRole.getIsActiveIsNotNull() && voAppRole.getIsActive().booleanValue())
		{
			grdRolesRow row = form.lyrTargets().tabActioningRoles().grdRoles().getRows().newRow();
			row.setColImage(form.getImages().OCRR.Role);
			row.setColRole(voAppRole.getName());
			if (event != null &&
					event.getActioningRolesIsNotNull())
			{
				for (int j = 0; j < event.getActioningRoles().size(); j++) 
				{
					if (voAppRole.getName().equals(event.getActioningRoles().get(j).getName()))
					{
						row.setColSelect(true);
					}
				}
			}
			
			row.setValue(voAppRole);
		}
	}		
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateExternalEventMappingsGrid(EventVo event)
{
	EventExternalEventMappingVoCollection editedRecord = domain.getEventExternalEventMapping(event, event.getStatus());
	form.getLocalContext().setEventExternalEventMappingOriginalCollection(editedRecord);
	form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().clear();
	
	for (int i = 0; i < editedRecord.size(); i++) 
	{
		grdExternalEventMappingsRow row = form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().newRow();
		row.setColImage(form.getImages().OCRR.Sent);
		row.setColProviderSystem(editedRecord.get(i).getExternalEventMapping().getProviderSystem().getSystemName());
		row.setTooltipForColProviderSystem(editedRecord.get(i).getExternalEventMapping().getProviderSystem().getSystemName());
		row.setColGroup(editedRecord.get(i).getExternalEventMapping().getGroupIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getGroup().toString() : null);
		row.setTooltipForColGroup(editedRecord.get(i).getExternalEventMapping().getGroupIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getGroup().toString() : null);
		row.setColDetail(editedRecord.get(i).getExternalEventMapping().getDetailIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getDetail().toString() : null);
		row.setTooltipForColDetail(editedRecord.get(i).getExternalEventMapping().getDetailIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getDetail().toString() : null);
		row.setColSpecialty(editedRecord.get(i).getExternalEventMapping().getSpecialtyIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getSpecialty().toString() : null);
		row.setTooltipForColSpecialty(editedRecord.get(i).getExternalEventMapping().getSpecialtyIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getSpecialty().toString() : null);
		row.setColConsultant(editedRecord.get(i).getExternalEventMapping().getConsultantIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getConsultant().toString() : null);
		row.setTooltipForColConsultant(editedRecord.get(i).getExternalEventMapping().getConsultantIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getConsultant().toString() : null);
		row.setColClinicCode(editedRecord.get(i).getExternalEventMapping().getClinicCodeIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getClinicCode() : null);
		row.setTooltipForColClinicCode(editedRecord.get(i).getExternalEventMapping().getClinicCodeIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getClinicCode() : null);
		row.setColDescription(editedRecord.get(i).getExternalEventMapping().getDescriptionIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getDescription() : null);
		row.setTooltipForColDescription(editedRecord.get(i).getExternalEventMapping().getDescriptionIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getDescription() : null);
		row.setColStatus(editedRecord.get(i).getStatus());
		
		row.setValue(editedRecord.get(i));	
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private EventExternalEventMappingVoCollection populateExternalEventMappingsFromExternalMappingGrid()
{
	EventExternalEventMappingVoCollection voColl = new EventExternalEventMappingVoCollection();
	for (int i = 0; i < form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().size(); i++)
	{
		ExternalEventMappingVo mapping = form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().get(i).getValue().getExternalEventMapping();
		EventVo event = form.getLocalContext().getEditedRecordIsNotNull() ? form.getLocalContext().getEditedRecord() : new EventVo();
		
		EventExternalEventMappingVo vo = populateEventExternalEventMapping(event, mapping);
		vo.setStatus(form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().get(i).getColStatus());
		
		if (form.getLocalContext().getEventExternalEventMappingOriginalCollectionIsNotNull())
		{
			for (int j = 0; j < form.getLocalContext().getEventExternalEventMappingOriginalCollection().size(); j++) 
			{
				if (form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getEvent().equals(
						vo.getEvent()) &&
						form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getExternalEventMapping().equals(
								vo.getExternalEventMapping()))
								{
									if (form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getActivatedDateTime() != null)
									{
										vo.setActivatedDateTime(form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getActivatedDateTime());
										vo.setActivatedBy(form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getActivatedBy());
									}
									else if (form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getInactivatedBy() != null)
									{
										vo.setInactivatedDateTime(form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getInactivatedDateTime());
										vo.setInactivatedBy(form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getInactivatedBy());
									} 
								}
			}
		}
		
		voColl.add(vo);
	}
	
	return voColl;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private EventRTTEventVoCollection populateRTTEventFromRTTGrid()
{
	EventRTTEventVoCollection voColl = new EventRTTEventVoCollection();
	for (int i = 0; i < form.lyrTargets().tabRTT().grdRTT().getRows().size(); i++)
	{
		RTTEventVo rtt = form.lyrTargets().tabRTT().grdRTT().getRows().get(i).getValue().getRTTEvent();
		EventVo event = form.getLocalContext().getEditedRecordIsNotNull() ? form.getLocalContext().getEditedRecord() : new EventVo();
		
		EventRTTEventVo vo = populateEventRTTEvent(event, rtt);
		vo.setStatus(form.lyrTargets().tabRTT().grdRTT().getRows().get(i).getColStatus());
		
		if (form.getLocalContext().getEventRTTEventOriginalCollectionIsNotNull())
		{
			for (int j = 0; j < form.getLocalContext().getEventRTTEventOriginalCollection().size(); j++) 
			{
				if (form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getEvent().equals(
						vo.getEvent()) &&
						form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getRTTEvent().equals(
								vo.getRTTEvent()))
								{
									if (form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getActivatedDateTime() != null)
									{
										vo.setActivatedDateTime(form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getActivatedDateTime());
										vo.setActivatedBy(form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getActivatedBy());
									}
									else if (form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getInactivatedBy() != null)
									{
										vo.setInactivatedDateTime(form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getInactivatedDateTime());
										vo.setInactivatedBy(form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getInactivatedBy());
									} 
								}
			}
		}
		
		voColl.add(vo);	
	}
	
	return voColl;
}
 
Example 21
Project: AvoinApotti   File: HL7PathwayIfImpl.java   View source code 5 votes vote down vote up
/**
* This method will retrieve the Event based on the External Event information passed in
 * @throws DomainInterfaceException 
*/
public EventVo getEventByExternalMappings(ims.pathways.configuration.vo.ExternalEventMappingRefVo externalEvent) throws DomainInterfaceException
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer(" select ev.event from EventExternalEventMapping ev where ev.externalEventMapping.id = :eventMap and ev.status.id =:status and ev.event.status.id = :status");
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("eventMap");
	labels.add("status");
	values.add(externalEvent.getID_ExternalEventMapping());
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getId());
	
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 1)
	{
		throw new DomainInterfaceException("Duplicate data found when searching event by ExtMappings");
	}
	else if (lst != null && lst.size() == 1)
	{
		// Unique, so only one should be found??
		return EventVoAssembler.create((Event) lst.get(0));
	}
	
	return null;
}
 
Example 22
Project: AvoinApotti   File: HL7PathwayIfImpl.java   View source code 5 votes vote down vote up
/**
* Gets the event based on the RTT values passed in
 * @throws DomainInterfaceException 
*/
public ims.pathways.vo.EventVo getEventByRttValues(ims.pathways.configuration.vo.RTTEventRefVo rttEvent) throws DomainInterfaceException
{
	
	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer(" select ev.event from EventRTTEvent ev where ev.status.id = :status and ev.rTTEvent.id = :rttEvent and ev.event.status.id = :status");
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("status");
	labels.add("rttEvent");
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getId());
	values.add(rttEvent.getID_RTTEvent());
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 1)
	{
		throw new DomainInterfaceException("Duplicate data found when searching event by RttValues ");
	}
	else if (lst != null && lst.size() == 1)
	{
		// Unique, so only one should be found??
		return EventVoAssembler.create((Event) lst.get(0));
	}
	
	return null;
}
 
Example 23
Project: AvoinApotti   File: HL7PathwayIfImpl.java   View source code 5 votes vote down vote up
/**
* Gets the event based on the RTT values passed in
 * @throws DomainInterfaceException 
*/
public ims.pathways.vo.EventVo getEventByTaxonomyMap(TaxonomyType taxType, String value) throws DomainInterfaceException
{
	if (taxType == null || value == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer(" select ev from Event ev join ev.taxonomyMaps tx where ev.status.id = :status and tx.taxonomyName = :taxType and tx.taxonomyCode = :taxCode");
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("status");
	labels.add("taxType");
	labels.add("taxCode");
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getId());
	values.add(getDomLookup(taxType));
	values.add(value);
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 1)
	{
		throw new DomainInterfaceException("Duplicate data found when searching event by Taxonomy ");
	}
	else if (lst != null && lst.size() == 1)
	{
		// Unique, so only one should be found??
		return EventVoAssembler.create((Event) lst.get(0));
	}
	
	return null;
}
 
Example 24
Project: AvoinApotti   File: EventConfigurationImpl.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked") private void saveTargetEvents(EventVo event, DomainFactory factory, EventTargetVoCollection eventTargets) throws ForeignKeyViolationException, StaleObjectException, UniqueKeyViolationException, UnqViolationUncheckedException
{
	if (event.getID_Event() != null)
	{
		List oldEventsTargets = factory.find("from EventTarget et where et.event.id = '" + event.getID_Event().toString() + "'");
		Iterator oldEventsTargetsList = oldEventsTargets.iterator();
		while (oldEventsTargetsList.hasNext())
		{
			EventTarget doOldEventTarget = (EventTarget) oldEventsTargetsList.next();
			factory.delete(doOldEventTarget);
		}
	}
	else
	{
		return;
	}

	for (int i = 0; i < eventTargets.size(); i++)
	{
		eventTargets.get(i).getEvent().setID_Event(event.getID_Event());
		eventTargets.get(i).setID_EventTarget(null);
	}

	// Save eventTarget
	List newEventsTargets = EventTargetVoAssembler.extractEventTargetList(factory, eventTargets);
	Iterator newEventsTargetsList = newEventsTargets.iterator();

	while (newEventsTargetsList.hasNext())
	{
		EventTarget doNewEventTarget = (EventTarget) newEventsTargetsList.next();
		factory.save(doNewEventTarget);
	}
}
 
Example 25
Project: AvoinApotti   File: EventConfigurationImpl.java   View source code 5 votes vote down vote up
public EventVo getEvent(EventRefVo voRef)
{
	if (voRef == null)
		throw new DomainRuntimeException("Cannot get EventVo for null EventRefVo");

	DomainFactory factory = getDomainFactory();
	Event doEvent = (Event) factory.getDomainObject(Event.class, voRef.getID_Event());
	return EventVoAssembler.create(doEvent);
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateScreenFromData(EventVo editedRecord) 
{
	if (editedRecord != null)
	{
		form.txtName().setValue(editedRecord.getName());
		form.txtDesc().setValue(editedRecord.getDescription());
	
		if (editedRecord.getIcon() != null)
		{
			form.qmbImage().newRow(editedRecord.getIcon(), editedRecord.getIcon().getImagePath(), engine.getRegisteredImage(editedRecord.getIcon().getImageId()));	
			form.qmbImage().setValue(editedRecord.getIcon());
		}
	
		form.cmbStatus().newRow(editedRecord.getStatus(), editedRecord.getStatus().getText());
		form.cmbStatus().setValue(editedRecord.getStatus());
		
		form.cmbEventType().setValue(editedRecord.getEventType());
	
		form.customControlMappings().setValue(editedRecord.getTaxonomyMaps());
		form.chkDisplayInPatientDiary().setValue(editedRecord.getPatientDiaryImpactIsNotNull() ? editedRecord.getPatientDiaryImpact() : false);
		form.chkStartsClock().setValue(editedRecord.getStartsClockIsNotNull() ? editedRecord.getStartsClock() : false);
		form.chkStopClocks().setValue(editedRecord.getStopsClockIsNotNull() ? editedRecord.getStopsClock() : false);
		form.chkEndsPathway().setValue(editedRecord.getEndsPathwayIsNotNull() ? editedRecord.getEndsPathway() : false);		
		form.cmbType().setValue(editedRecord.getCancellationType());
		form.cmbReason().setValue(editedRecord.getCancellationReason());
		form.chkScheduleEvent().setValue(editedRecord.getIsManualScheduledEventIsNotNull() ? editedRecord.getIsManualScheduledEvent() : false);	
	}

	updateChkScheduleControlState();
	populateExternalEventMappingsGrid(editedRecord);
	populateRTTEventGrid(editedRecord);
	populateEventTargetDinamicGrid(editedRecord);
	populateRolesGrid(editedRecord);
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private EventExternalEventMappingVo populateEventExternalEventMapping(EventVo event, ExternalEventMappingVo mapping) 
{
	EventExternalEventMappingVo vo = new EventExternalEventMappingVo();
	vo.setEvent(event);
	vo.setExternalEventMapping(mapping);	
	vo.setStatus(form.cmbStatus().getValue());
	return vo;
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private EventRTTEventVo populateEventRTTEvent(EventVo event, RTTEventVo rtt) 
{
	EventRTTEventVo vo = new EventRTTEventVo();
	vo.setEvent(event);
	vo.setRTTEvent(rtt);
	vo.setStatus(form.cmbStatus().getValue());
	return vo;
}
 
Example 29
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateRolesGrid(EventVo event) 
{
	form.lyrTargets().tabActioningRoles().grdRoles().getRows().clear();
	
	AppRoleShortVoCollection voColl = domain.listRoles();
	if (voColl == null)
		return;
	
	form.lyrTargets().tabActioningRoles().grdRoles().getRows().clear();
	for (int i = 0; i < voColl.size(); i++)
	{
		AppRoleShortVo voAppRole = voColl.get(i);
		if(voAppRole.getIsActiveIsNotNull() && voAppRole.getIsActive().booleanValue())
		{
			grdRolesRow row = form.lyrTargets().tabActioningRoles().grdRoles().getRows().newRow();
			row.setColImage(form.getImages().OCRR.Role);
			row.setColRole(voAppRole.getName());
			if (event != null &&
					event.getActioningRolesIsNotNull())
			{
				for (int j = 0; j < event.getActioningRoles().size(); j++) 
				{
					if (voAppRole.getName().equals(event.getActioningRoles().get(j).getName()))
					{
						row.setColSelect(true);
					}
				}
			}
			
			row.setValue(voAppRole);
		}
	}		
}
 
Example 30
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateExternalEventMappingsGrid(EventVo event)
{
	EventExternalEventMappingVoCollection editedRecord = domain.getEventExternalEventMapping(event, event.getStatus());
	form.getLocalContext().setEventExternalEventMappingOriginalCollection(editedRecord);
	form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().clear();
	
	for (int i = 0; i < editedRecord.size(); i++) 
	{
		grdExternalEventMappingsRow row = form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().newRow();
		row.setColImage(form.getImages().OCRR.Sent);
		row.setColProviderSystem(editedRecord.get(i).getExternalEventMapping().getProviderSystem().getSystemName());
		row.setTooltipForColProviderSystem(editedRecord.get(i).getExternalEventMapping().getProviderSystem().getSystemName());
		row.setColGroup(editedRecord.get(i).getExternalEventMapping().getGroupIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getGroup().toString() : null);
		row.setTooltipForColGroup(editedRecord.get(i).getExternalEventMapping().getGroupIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getGroup().toString() : null);
		row.setColDetail(editedRecord.get(i).getExternalEventMapping().getDetailIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getDetail().toString() : null);
		row.setTooltipForColDetail(editedRecord.get(i).getExternalEventMapping().getDetailIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getDetail().toString() : null);
		row.setColSpecialty(editedRecord.get(i).getExternalEventMapping().getSpecialtyIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getSpecialty().toString() : null);
		row.setTooltipForColSpecialty(editedRecord.get(i).getExternalEventMapping().getSpecialtyIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getSpecialty().toString() : null);
		row.setColConsultant(editedRecord.get(i).getExternalEventMapping().getConsultantIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getConsultant().toString() : null);
		row.setTooltipForColConsultant(editedRecord.get(i).getExternalEventMapping().getConsultantIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getConsultant().toString() : null);
		row.setColClinicCode(editedRecord.get(i).getExternalEventMapping().getClinicCodeIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getClinicCode() : null);
		row.setTooltipForColClinicCode(editedRecord.get(i).getExternalEventMapping().getClinicCodeIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getClinicCode() : null);
		row.setColDescription(editedRecord.get(i).getExternalEventMapping().getDescriptionIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getDescription() : null);
		row.setTooltipForColDescription(editedRecord.get(i).getExternalEventMapping().getDescriptionIsNotNull() ? editedRecord.get(i).getExternalEventMapping().getDescription() : null);
		row.setColStatus(editedRecord.get(i).getStatus());
		
		row.setValue(editedRecord.get(i));	
	}
}
 
Example 31
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private EventExternalEventMappingVoCollection populateExternalEventMappingsFromExternalMappingGrid()
{
	EventExternalEventMappingVoCollection voColl = new EventExternalEventMappingVoCollection();
	for (int i = 0; i < form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().size(); i++)
	{
		ExternalEventMappingVo mapping = form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().get(i).getValue().getExternalEventMapping();
		EventVo event = form.getLocalContext().getEditedRecordIsNotNull() ? form.getLocalContext().getEditedRecord() : new EventVo();
		
		EventExternalEventMappingVo vo = populateEventExternalEventMapping(event, mapping);
		vo.setStatus(form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().get(i).getColStatus());
		
		if (form.getLocalContext().getEventExternalEventMappingOriginalCollectionIsNotNull())
		{
			for (int j = 0; j < form.getLocalContext().getEventExternalEventMappingOriginalCollection().size(); j++) 
			{
				if (form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getEvent().equals(
						vo.getEvent()) &&
						form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getExternalEventMapping().equals(
								vo.getExternalEventMapping()))
								{
									if (form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getActivatedDateTime() != null)
									{
										vo.setActivatedDateTime(form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getActivatedDateTime());
										vo.setActivatedBy(form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getActivatedBy());
									}
									else if (form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getInactivatedBy() != null)
									{
										vo.setInactivatedDateTime(form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getInactivatedDateTime());
										vo.setInactivatedBy(form.getLocalContext().getEventExternalEventMappingOriginalCollection().get(j).getInactivatedBy());
									} 
								}
			}
		}
		
		voColl.add(vo);
	}
	
	return voColl;
}
 
Example 32
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private EventRTTEventVoCollection populateRTTEventFromRTTGrid()
{
	EventRTTEventVoCollection voColl = new EventRTTEventVoCollection();
	for (int i = 0; i < form.lyrTargets().tabRTT().grdRTT().getRows().size(); i++)
	{
		RTTEventVo rtt = form.lyrTargets().tabRTT().grdRTT().getRows().get(i).getValue().getRTTEvent();
		EventVo event = form.getLocalContext().getEditedRecordIsNotNull() ? form.getLocalContext().getEditedRecord() : new EventVo();
		
		EventRTTEventVo vo = populateEventRTTEvent(event, rtt);
		vo.setStatus(form.lyrTargets().tabRTT().grdRTT().getRows().get(i).getColStatus());
		
		if (form.getLocalContext().getEventRTTEventOriginalCollectionIsNotNull())
		{
			for (int j = 0; j < form.getLocalContext().getEventRTTEventOriginalCollection().size(); j++) 
			{
				if (form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getEvent().equals(
						vo.getEvent()) &&
						form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getRTTEvent().equals(
								vo.getRTTEvent()))
								{
									if (form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getActivatedDateTime() != null)
									{
										vo.setActivatedDateTime(form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getActivatedDateTime());
										vo.setActivatedBy(form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getActivatedBy());
									}
									else if (form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getInactivatedBy() != null)
									{
										vo.setInactivatedDateTime(form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getInactivatedDateTime());
										vo.setInactivatedBy(form.getLocalContext().getEventRTTEventOriginalCollection().get(j).getInactivatedBy());
									} 
								}
			}
		}
		
		voColl.add(vo);	
	}
	
	return voColl;
}
 
Example 33
Project: openMAXIMS   File: HL7PathwayIfImpl.java   View source code 5 votes vote down vote up
/**
* This method will retrieve the Event based on the External Event information passed in
 * @throws DomainInterfaceException 
*/
public EventVo getEventByExternalMappings(ims.pathways.configuration.vo.ExternalEventMappingRefVo externalEvent) throws DomainInterfaceException
{
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer(" select ev.event from EventExternalEventMapping ev where ev.externalEventMapping.id = :eventMap and ev.status.id =:status and ev.event.status.id = :status");
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("eventMap");
	labels.add("status");
	values.add(externalEvent.getID_ExternalEventMapping());
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getId());
	
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 1)
	{
		throw new DomainInterfaceException("Duplicate data found when searching event by ExtMappings");
	}
	else if (lst != null && lst.size() == 1)
	{
		// Unique, so only one should be found??
		return EventVoAssembler.create((Event) lst.get(0));
	}
	
	return null;
}
 
Example 34
Project: openMAXIMS   File: HL7PathwayIfImpl.java   View source code 5 votes vote down vote up
/**
* Gets the event based on the RTT values passed in
 * @throws DomainInterfaceException 
*/
public ims.pathways.vo.EventVo getEventByRttValues(ims.pathways.configuration.vo.RTTEventRefVo rttEvent) throws DomainInterfaceException
{
	
	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer(" select ev.event from EventRTTEvent ev where ev.status.id = :status and ev.rTTEvent.id = :rttEvent and ev.event.status.id = :status");
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("status");
	labels.add("rttEvent");
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getId());
	values.add(rttEvent.getID_RTTEvent());
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 1)
	{
		throw new DomainInterfaceException("Duplicate data found when searching event by RttValues ");
	}
	else if (lst != null && lst.size() == 1)
	{
		// Unique, so only one should be found??
		return EventVoAssembler.create((Event) lst.get(0));
	}
	
	return null;
}
 
Example 35
Project: openMAXIMS   File: HL7PathwayIfImpl.java   View source code 5 votes vote down vote up
/**
* Gets the event based on the RTT values passed in
 * @throws DomainInterfaceException 
*/
public ims.pathways.vo.EventVo getEventByTaxonomyMap(TaxonomyType taxType, String value) throws DomainInterfaceException
{
	if (taxType == null || value == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer(" select ev from Event ev join ev.taxonomyMaps tx where ev.status.id = :status and tx.taxonomyName = :taxType and tx.taxonomyCode = :taxCode");
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("status");
	labels.add("taxType");
	labels.add("taxCode");
	values.add(PreActiveActiveInactiveStatus.ACTIVE.getId());
	values.add(getDomLookup(taxType));
	values.add(value);
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 1)
	{
		throw new DomainInterfaceException("Duplicate data found when searching event by Taxonomy ");
	}
	else if (lst != null && lst.size() == 1)
	{
		// Unique, so only one should be found??
		return EventVoAssembler.create((Event) lst.get(0));
	}
	
	return null;
}
 
Example 36
Project: openMAXIMS   File: EventConfigurationImpl.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked") private void saveTargetEvents(EventVo event, DomainFactory factory, EventTargetVoCollection eventTargets) throws ForeignKeyViolationException, StaleObjectException, UniqueKeyViolationException, UnqViolationUncheckedException
{
	if (event.getID_Event() != null)
	{
		List oldEventsTargets = factory.find("from EventTarget et where et.event.id = '" + event.getID_Event().toString() + "'");
		Iterator oldEventsTargetsList = oldEventsTargets.iterator();
		while (oldEventsTargetsList.hasNext())
		{
			EventTarget doOldEventTarget = (EventTarget) oldEventsTargetsList.next();
			factory.delete(doOldEventTarget);
		}
	}
	else
	{
		return;
	}

	for (int i = 0; i < eventTargets.size(); i++)
	{
		eventTargets.get(i).getEvent().setID_Event(event.getID_Event());
		eventTargets.get(i).setID_EventTarget(null);
	}

	// Save eventTarget
	List newEventsTargets = EventTargetVoAssembler.extractEventTargetList(factory, eventTargets);
	Iterator newEventsTargetsList = newEventsTargets.iterator();

	while (newEventsTargetsList.hasNext())
	{
		EventTarget doNewEventTarget = (EventTarget) newEventsTargetsList.next();
		factory.save(doNewEventTarget);
	}
}
 
Example 37
Project: openMAXIMS   File: EventConfigurationImpl.java   View source code 5 votes vote down vote up
public EventVo getEvent(EventRefVo voRef)
{
	if (voRef == null)
		throw new DomainRuntimeException("Cannot get EventVo for null EventRefVo");

	DomainFactory factory = getDomainFactory();
	Event doEvent = (Event) factory.getDomainObject(Event.class, voRef.getID_Event());
	return EventVoAssembler.create(doEvent);
}
 
Example 38
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateScreenFromData(EventVo editedRecord) 
{
	if (editedRecord != null)
	{
		form.txtName().setValue(editedRecord.getName());
		form.txtDesc().setValue(editedRecord.getDescription());
	
		if (editedRecord.getIcon() != null)
		{
			form.qmbImage().newRow(editedRecord.getIcon(), editedRecord.getIcon().getImagePath(), engine.getRegisteredImage(editedRecord.getIcon().getImageId()));	
			form.qmbImage().setValue(editedRecord.getIcon());
		}
	
		form.cmbStatus().newRow(editedRecord.getStatus(), editedRecord.getStatus().getText());
		form.cmbStatus().setValue(editedRecord.getStatus());
		
		form.cmbEventType().setValue(editedRecord.getEventType());
	
		form.customControlMappings().setValue(editedRecord.getTaxonomyMaps());
		form.chkDisplayInPatientDiary().setValue(editedRecord.getPatientDiaryImpactIsNotNull() ? editedRecord.getPatientDiaryImpact() : false);
		form.chkStartsClock().setValue(editedRecord.getStartsClockIsNotNull() ? editedRecord.getStartsClock() : false);
		form.chkStopClocks().setValue(editedRecord.getStopsClockIsNotNull() ? editedRecord.getStopsClock() : false);
		form.chkEndsPathway().setValue(editedRecord.getEndsPathwayIsNotNull() ? editedRecord.getEndsPathway() : false);			
		form.chkScheduleEvent().setValue(editedRecord.getIsManualScheduledEventIsNotNull() ? editedRecord.getIsManualScheduledEvent() : false);	
	}

	updateChkScheduleControlState();
	populateExternalEventMappingsGrid(editedRecord);
	populateRTTEventGrid(editedRecord);
	populateEventTargetDinamicGrid(editedRecord);
	populateRolesGrid(editedRecord);
}
 
Example 39
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private EventExternalEventMappingVo populateEventExternalEventMapping(EventVo event, ExternalEventMappingVo mapping) 
{
	EventExternalEventMappingVo vo = new EventExternalEventMappingVo();
	vo.setEvent(event);
	vo.setExternalEventMapping(mapping);	
	vo.setStatus(form.cmbStatus().getValue());
	return vo;
}
 
Example 40
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private EventRTTEventVo populateEventRTTEvent(EventVo event, RTTEventVo rtt) 
{
	EventRTTEventVo vo = new EventRTTEventVo();
	vo.setEvent(event);
	vo.setRTTEvent(rtt);
	vo.setStatus(form.cmbStatus().getValue());
	return vo;
}