Java Code Examples for ims.core.vo.ServiceVo

The following are top voted examples for showing how to use ims.core.vo.ServiceVo. 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   Source Code and License 6 votes vote down vote up
private void searchProfiles()
{
	form.grdProfiles().getRows().clear();
	clearScreen();//WDEV-14644
	//WDEV-16799
	ProfileShortVoCollection coll = domain.listProfiles((ServiceVo) form.cmbFilterSpecialty().getValue(), form.qmbFilterDirectoryOfService().getValue(), form.cmbHospFilter().getValue(), form.chkActiveOnly().getValue() == false ? null : true, form.chkFilterOutpatients().getValue(), form.chkFilterTheatre().getValue(), form.txtName().getValue(), form.ccListOwner().getValue());
	if (coll == null || coll.size() == 0)
		return;

	GenForm.grdProfilesRow row;
	for (int i = 0; i < coll.size(); i++)
	{
		ProfileShortVo prfile = coll.get(i);
		row = form.grdProfiles().getRows().newRow();
		row.setValue(prfile);
		if (prfile.getEffToIsNotNull())
			row.setcolEndDate(prfile.getEffTo().toString());
		if (prfile.getEffFrmIsNotNull())
			row.setcolStartDate(prfile.getEffFrm().toString());
		row.setcolProfileDescription(prfile.getDescription());
		if (prfile.getServiceIsNotNull())
			row.setcolSpeciality(prfile.getService().getServiceName());
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public void populateScreenFromData(ServiceVo voService, TreeNode node)
{
	// clear out instance data for next edit
	clearInstanceControls();

	super.populateScreenFromData(voService); // do this anyway for
												// ServiceVo info
	cmbCategoryValueChanged();				//wdev-16371

	// additional info for ServiceFunction and ServiceActivity
	// set local context function and activity collections for current
	// service selection
	populateScreenFromDataActivityFunction(node);

	populateScreenFromDataServiceInfo();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String formatServicevoTooltip(ServiceVo voService)
{
	String out = makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(true) + ": *", "DarkRed", "tahoma", "14");
	out += makeTextile(voService.getServiceNameIsNotNull() ? voService.getServiceName() : "", "black", "tahoma", "12");
	out += makeNewLine(new Integer(1));
	if (voService.getServiceDescriptionIsNotNull())
	{
		out += makeNewLine(new Integer(1));
		out += makeTextile("*Description: *", "DarkRed", "tahoma", "12");
		out += makeTextile(voService.getServiceDescription(), "black", "tahoma", "12");
	}
	if (voService.getIsActiveIsNotNull())
	{
		out += makeNewLine(new Integer(1));
		out += makeTextile("*Active: *", "DarkRed", "tahoma", "12");
		out += makeTextile(voService.getIsActive().toString(), "black", "tahoma", "12");
	}
	return new TextileString(out).toString();
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public boolean populateActivityFunctionDataFromScreen(ServiceVo voService) throws UniqueKeyViolationException
{
	boolean ret = false;
	if (checkForErrorsOnActivityFunction())
	{
		// update taxonomy contexts for last selected function and activity
		saveServiceActivityTaxonomy(voService);
		saveServiceFunctionTaxonomy(voService);

		// add/remove activities
		ret = saveServiceActivity();
		if (!ret)
			return ret;

		ret = saveServiceFunction();

		return ret;
	}

	return false;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void treeExpandCollapse(TreeNode node)
{
	if (node.isExpanded())
	{
		if (node.getNodes().size() > 0 && node.getNodes().get(0).getValue() == null)
		{
			if (node.getValue() instanceof ServiceVo)
				form.getLocalContext().setSelectedRecord((ServiceVo) node.getValue());
			populateServiceFunctionAndActivity(node);
		}
	}
	else
	{
		if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
		{
			if (node.getNodes().get(0).getText() == form.getLocalContext().gettreMessage())
			{
				node.getNodes().get(0).setText("Loading Please wait...");
			}
		}
	}
}
 
Example 6
Project: AvoinApotti   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
/**
 * expects parameters returns null if the parameters are not set
 */
public LocationServiceVoCollection listServicesForLocation(LocationRefVo location, ServiceVo service)
{
	DomainFactory factory = getDomainFactory();

	if (location == null || service == null)
		return null;

	if (location.getID_LocationIsNotNull() && service.getID_ServiceIsNotNull())
	{
		java.util.List servactList = factory.find("from  LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{location.getID_Location(), service.getID_Service()});
		return LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(servactList).sort();
	}

	return null;
}
 
Example 7
Project: AvoinApotti   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
	LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
	LocationServiceVo voLocSer = new LocationServiceVo();
	voLocSer.setService(voService);
	voLocSer.setIsActive(new Boolean(true));
	LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
	if (voColl != null && voColl.size() > 0)
	{

		String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
		for (int i = 0; i < voColl.size(); i++)
		{
			activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
		}

		return activeMessage;
	}
	else
		return null;
}
 
Example 8
Project: AvoinApotti   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
public String isServiceActivityUnique(TaxonomyMapCollection map, ServiceVo voService)
{
	DomainFactory factory = getDomainFactory();

	if (map != null)
	{
		String result = "";
		for (int i = 0; i < map.size(); i++)
		{
			java.util.List list = factory.find("select s1_1.service.id, s2_1.serviceName, t1_1.taxonomyCode, l1_1.id from ServiceActivity as s1_1 left join s1_1.service as s2_1 left join s1_1.taxonomyMap as t1_1 left join t1_1.taxonomyName as l1_1 where (t1_1.taxonomyCode = :code and s2_1.serviceName <> :name and l1_1.id = :id)", new String[]{"code", "name", "id"}, new Object[]{map.get(i).getTaxonomyCode(), voService.getServiceName(), new Integer(map.get(i).getTaxonomyName().getID())});

			if (list.size() != 0 && map.get(i).getTaxonomyCodeIsNotNull())
				result = result + (map.get(i).getTaxonomyCode() + " ");

		}
		return result;
	}

	return "";
}
 
Example 9
Project: AvoinApotti   File: ReferralDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
private EpisodeofCareShortVo updateEpisodeOfCareSpecialty(CatsReferralWizardVo catsReferralVo, ReferralLetterDetailsVo referralDetailsVo, DomainFactory factory) throws StaleObjectException
{
	CareContextVo voCC = CareContextVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, catsReferralVo.getCareContext().getID_CareContext()));
	ServiceVo voServ = ServiceVoAssembler.create((ims.core.clinical.domain.objects.Service) getDomainFactory().getDomainObject(ims.core.clinical.domain.objects.Service.class, referralDetailsVo.getService().getID_Service()));

	EpisodeOfCare doEOC = (EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, voCC.getEpisodeOfCare().getID_EpisodeOfCare());
	if (doEOC != null)
	{
		//WDEV-11535 - if referral service.specialty is null set it back to DAD
		Specialty spec = null;
		if(voServ.getSpecialty() == null)
			spec = Specialty.DAD;
		else
			spec = voServ.getSpecialty();
		
		doEOC.setSpecialty(getDomLookup(spec));			
		factory.save(doEOC);
		
		return EpisodeofCareShortVoAssembler.create(doEOC);
	}
	
	return null;
}
 
Example 10
Project: AvoinApotti   File: PresentationComponentImpl.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public ServiceVo getService(Integer id)
{
	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer("select service from CatsReferral as catsRef join catsRef.referralDetails" +
			" as referal join referal.service as service where catsRef.id = "+id);
	
	List domService = factory.find(hql.toString());
	
	ServiceVoCollection serviceColl = ServiceVoAssembler.createServiceVoCollectionFromService(domService);
	if(serviceColl.size() > 0)
		return serviceColl.get(0);
	else
		return null;

}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateServiceDetails(ServiceVo service)
{
	clearServiceDetailsScreen();
	
	if(service == null)
		return;
	
	form.lyrService().tabServiceDetails().txtService().setValue(service.getServiceName());
	form.lyrService().tabServiceDetails().txtDescription().setValue(service.getServiceDescription());
	form.lyrService().tabServiceDetails().cmbCat().setValue(service.getServiceCategory());
	form.lyrService().tabServiceDetails().cmbSpec().setValue(service.getSpecialty());
	form.lyrService().tabServiceDetails().chkActiveOnly().setValue(Boolean.TRUE.equals(service.getIsActive()));
	form.lyrService().tabServiceDetails().chkCanBeScheduled().setValue(Boolean.TRUE.equals(service.getCanBeScheduled()));
	form.lyrService().tabServiceDetails().chkPreAssessmentCompletionExempt().setValue(Boolean.TRUE.equals(service.getIsPreAssessmentCompletionExempt()));
	form.lyrService().tabServiceDetails().chkRTT().setValue(Boolean.TRUE.equals(service.getIsSubjectToRTTClock()));
	form.lyrService().tabServiceDetails().chkMaternityIndicator().setValue(Boolean.TRUE.equals(service.getMaternityIndicator()));
	form.lyrService().tabServiceDetails().chkCanReferIntoTheService().setValue(Boolean.TRUE.equals(service.getCanReferIntoTheService()));
	form.lyrService().tabServiceDetails().chkDirectSelfReferralsAccepted().setValue(Boolean.TRUE.equals(service.getDirectSelfReferralsAccepted()));
	
	form.lyrService().tabServiceDetails().txtAlternativeCode().setValue(service.getAlternateServiceCode());
	form.lyrService().tabServiceDetails().cmbTurnAroundMeasure().setValue(service.getTurnaroundMeasure());
	form.lyrService().tabServiceDetails().intExpectedTurnAround().setValue(service.getExpectedTurnaround());
	
	form.lyrService().tabServiceDetails().ccServiceCodeMappings().setValue(service.getTaxonomyMap());
}
 
Example 12
Project: openMAXIMS   File: ServiceConfigurationImpl.java   Source Code and License 6 votes vote down vote up
public ServiceVo getService(ServiceRefVo service)
{
	if(service == null || service.getID_Service() == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	ServiceVo serviceVo = ServiceVoAssembler.create((Service) factory.getDomainObject(Service.class, service.getID_Service()));
	
	String hql = "select count(s.id) from ReferralService as rs left join rs.referralServices as s where s.id = :ServiceId";
	Object[] count = factory.find(hql, new String[] {"ServiceId"}, new Object[] {serviceVo.getID_Service()}).toArray();
	
	if(count != null && count.length > 0 && ((Long) count[0]).intValue() > 0)
		serviceVo.setCanReferIntoTheService(true);
	else
		serviceVo.setCanReferIntoTheService(false);
	
	return serviceVo;
}
 
Example 13
Project: openMAXIMS   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
/**
 * expects parameters returns null if the parameters are not set
 */
public LocationServiceVoCollection listServicesForLocation(LocationRefVo location, ServiceVo service)
{
	DomainFactory factory = getDomainFactory();

	if (location == null || service == null)
		return null;

	if (location.getID_LocationIsNotNull() && service.getID_ServiceIsNotNull())
	{
		java.util.List servactList = factory.find("from  LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{location.getID_Location(), service.getID_Service()});
		return LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(servactList).sort();
	}

	return null;
}
 
Example 14
Project: openMAXIMS   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
	LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
	LocationServiceVo voLocSer = new LocationServiceVo();
	voLocSer.setService(voService);
	voLocSer.setIsActive(new Boolean(true));
	LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
	if (voColl != null && voColl.size() > 0)
	{

		String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
		for (int i = 0; i < voColl.size(); i++)
		{
			activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
		}

		return activeMessage;
	}
	else
		return null;
}
 
Example 15
Project: openMAXIMS   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
public String isServiceActivityUnique(TaxonomyMapCollection map, ServiceVo voService)
{
	DomainFactory factory = getDomainFactory();

	if (map != null)
	{
		String result = "";
		for (int i = 0; i < map.size(); i++)
		{
			java.util.List list = factory.find("select s1_1.service.id, s2_1.serviceName, t1_1.taxonomyCode, l1_1.id from ServiceActivity as s1_1 left join s1_1.service as s2_1 left join s1_1.taxonomyMap as t1_1 left join t1_1.taxonomyName as l1_1 where (t1_1.taxonomyCode = :code and s2_1.serviceName <> :name and l1_1.id = :id)", new String[]{"code", "name", "id"}, new Object[]{map.get(i).getTaxonomyCode(), voService.getServiceName(), new Integer(map.get(i).getTaxonomyName().getID())});

			if (list.size() != 0 && map.get(i).getTaxonomyCodeIsNotNull())
				result = result + (map.get(i).getTaxonomyCode() + " ");

		}
		return result;
	}

	return "";
}
 
Example 16
Project: openMAXIMS   File: ReferralDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
private EpisodeofCareShortVo updateEpisodeOfCareSpecialty(CatsReferralWizardVo catsReferralVo, ReferralLetterDetailsVo referralDetailsVo, DomainFactory factory) throws StaleObjectException
{
	CareContextVo voCC = CareContextVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, catsReferralVo.getCareContext().getID_CareContext()));
	ServiceVo voServ = ServiceVoAssembler.create((ims.core.clinical.domain.objects.Service) getDomainFactory().getDomainObject(ims.core.clinical.domain.objects.Service.class, referralDetailsVo.getService().getID_Service()));

	EpisodeOfCare doEOC = (EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, voCC.getEpisodeOfCare().getID_EpisodeOfCare());
	if (doEOC != null)
	{
		//WDEV-11535 - if referral service.specialty is null set it back to DAD
		Specialty spec = null;
		if(voServ.getSpecialty() == null)
			spec = Specialty.DAD;
		else
			spec = voServ.getSpecialty();
		
		doEOC.setSpecialty(getDomLookup(spec));			
		factory.save(doEOC);
		
		return EpisodeofCareShortVoAssembler.create(doEOC);
	}
	
	return null;
}
 
Example 17
Project: openMAXIMS   File: PresentationComponentImpl.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public ServiceVo getService(Integer id)
{
	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer("select service from CatsReferral as catsRef join catsRef.referralDetails" +
			" as referal join referal.service as service where catsRef.id = "+id);
	
	List domService = factory.find(hql.toString());
	
	ServiceVoCollection serviceColl = ServiceVoAssembler.createServiceVoCollectionFromService(domService);
	if(serviceColl.size() > 0)
		return serviceColl.get(0);
	else
		return null;

}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void searchProfiles()
{
	form.grdProfiles().getRows().clear();
	clearScreen();//WDEV-14644
	//WDEV-16799
	ProfileShortVoCollection coll = domain.listProfiles((ServiceVo) form.cmbFilterSpecialty().getValue(), form.qmbFilterDirectoryOfService().getValue(), form.cmbHospFilter().getValue(), form.chkActiveOnly().getValue() == false ? null : true, form.chkFilterOutpatients().getValue(), form.chkFilterTheatre().getValue(), form.txtName().getValue(), form.ccListOwner().getValue());
	if (coll == null || coll.size() == 0)
		return;

	GenForm.grdProfilesRow row;
	for (int i = 0; i < coll.size(); i++)
	{
		ProfileShortVo prfile = coll.get(i);
		row = form.grdProfiles().getRows().newRow();
		row.setValue(prfile);
		if (prfile.getEffToIsNotNull())
			row.setcolEndDate(prfile.getEffTo().toString());
		if (prfile.getEffFrmIsNotNull())
			row.setcolStartDate(prfile.getEffFrm().toString());
		row.setcolProfileDescription(prfile.getDescription());
		if (prfile.getServiceIsNotNull())
			row.setcolSpeciality(prfile.getService().getServiceName());
	}
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public void populateScreenFromData(ServiceVo voService, TreeNode node)
{
	// clear out instance data for next edit
	clearInstanceControls();

	super.populateScreenFromData(voService); // do this anyway for
												// ServiceVo info
	cmbCategoryValueChanged();				//wdev-16371

	// additional info for ServiceFunction and ServiceActivity
	// set local context function and activity collections for current
	// service selection
	populateScreenFromDataActivityFunction(node);

	populateScreenFromDataServiceInfo();
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String formatServicevoTooltip(ServiceVo voService)
{
	String out = makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(true) + ": *", "DarkRed", "tahoma", "14");
	out += makeTextile(voService.getServiceNameIsNotNull() ? voService.getServiceName() : "", "black", "tahoma", "12");
	out += makeNewLine(new Integer(1));
	if (voService.getServiceDescriptionIsNotNull())
	{
		out += makeNewLine(new Integer(1));
		out += makeTextile("*Description: *", "DarkRed", "tahoma", "12");
		out += makeTextile(voService.getServiceDescription(), "black", "tahoma", "12");
	}
	if (voService.getIsActiveIsNotNull())
	{
		out += makeNewLine(new Integer(1));
		out += makeTextile("*Active: *", "DarkRed", "tahoma", "12");
		out += makeTextile(voService.getIsActive().toString(), "black", "tahoma", "12");
	}
	return new TextileString(out).toString();
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public boolean populateActivityFunctionDataFromScreen(ServiceVo voService) throws UniqueKeyViolationException
{
	boolean ret = false;
	if (checkForErrorsOnActivityFunction())
	{
		// update taxonomy contexts for last selected function and activity
		saveServiceActivityTaxonomy(voService);
		saveServiceFunctionTaxonomy(voService);

		// add/remove activities
		ret = saveServiceActivity();
		if (!ret)
			return ret;

		ret = saveServiceFunction();

		return ret;
	}

	return false;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void treeExpandCollapse(TreeNode node)
{
	if (node.isExpanded())
	{
		if (node.getNodes().size() > 0 && node.getNodes().get(0).getValue() == null)
		{
			if (node.getValue() instanceof ServiceVo)
				form.getLocalContext().setSelectedRecord((ServiceVo) node.getValue());
			populateServiceFunctionAndActivity(node);
		}
	}
	else
	{
		if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
		{
			if (node.getNodes().get(0).getText() == form.getLocalContext().gettreMessage())
			{
				node.getNodes().get(0).setText("Loading Please wait...");
			}
		}
	}
}
 
Example 23
Project: openMAXIMS   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
/**
 * expects parameters returns null if the parameters are not set
 */
public LocationServiceVoCollection listServicesForLocation(LocationRefVo location, ServiceVo service)
{
	DomainFactory factory = getDomainFactory();

	if (location == null || service == null)
		return null;

	if (location.getID_LocationIsNotNull() && service.getID_ServiceIsNotNull())
	{
		java.util.List servactList = factory.find("from  LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{location.getID_Location(), service.getID_Service()});
		return LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(servactList).sort();
	}

	return null;
}
 
Example 24
Project: openMAXIMS   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
	LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
	LocationServiceVo voLocSer = new LocationServiceVo();
	voLocSer.setService(voService);
	voLocSer.setIsActive(new Boolean(true));
	LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
	if (voColl != null && voColl.size() > 0)
	{

		String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
		for (int i = 0; i < voColl.size(); i++)
		{
			activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
		}

		return activeMessage;
	}
	else
		return null;
}
 
Example 25
Project: openMAXIMS   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
public String isServiceActivityUnique(TaxonomyMapCollection map, ServiceVo voService)
{
	DomainFactory factory = getDomainFactory();

	if (map != null)
	{
		String result = "";
		for (int i = 0; i < map.size(); i++)
		{
			java.util.List list = factory.find("select s1_1.service.id, s2_1.serviceName, t1_1.taxonomyCode, l1_1.id from ServiceActivity as s1_1 left join s1_1.service as s2_1 left join s1_1.taxonomyMap as t1_1 left join t1_1.taxonomyName as l1_1 where (t1_1.taxonomyCode = :code and s2_1.serviceName <> :name and l1_1.id = :id)", new String[]{"code", "name", "id"}, new Object[]{map.get(i).getTaxonomyCode(), voService.getServiceName(), new Integer(map.get(i).getTaxonomyName().getID())});

			if (list.size() != 0 && map.get(i).getTaxonomyCodeIsNotNull())
				result = result + (map.get(i).getTaxonomyCode() + " ");

		}
		return result;
	}

	return "";
}
 
Example 26
Project: openMAXIMS   File: ReferralDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
private EpisodeofCareShortVo updateEpisodeOfCareSpecialty(CatsReferralWizardVo catsReferralVo, ReferralLetterDetailsVo referralDetailsVo, DomainFactory factory) throws StaleObjectException
{
	CareContextVo voCC = CareContextVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, catsReferralVo.getCareContext().getID_CareContext()));
	ServiceVo voServ = ServiceVoAssembler.create((ims.core.clinical.domain.objects.Service) getDomainFactory().getDomainObject(ims.core.clinical.domain.objects.Service.class, referralDetailsVo.getService().getID_Service()));

	EpisodeOfCare doEOC = (EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, voCC.getEpisodeOfCare().getID_EpisodeOfCare());
	if (doEOC != null)
	{
		//WDEV-11535 - if referral service.specialty is null set it back to DAD
		Specialty spec = null;
		if(voServ.getSpecialty() == null)
			spec = Specialty.DAD;
		else
			spec = voServ.getSpecialty();
		
		doEOC.setSpecialty(getDomLookup(spec));			
		factory.save(doEOC);
		
		return EpisodeofCareShortVoAssembler.create(doEOC);
	}
	
	return null;
}
 
Example 27
Project: openMAXIMS   File: PresentationComponentImpl.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public ServiceVo getService(Integer id)
{
	DomainFactory factory = getDomainFactory();
	
	StringBuffer hql = new StringBuffer("select service from CatsReferral as catsRef join catsRef.referralDetails" +
			" as referal join referal.service as service where catsRef.id = "+id);
	
	List domService = factory.find(hql.toString());
	
	ServiceVoCollection serviceColl = ServiceVoAssembler.createServiceVoCollectionFromService(domService);
	if(serviceColl.size() > 0)
		return serviceColl.get(0);
	else
		return null;

}
 
Example 28
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void searchProfiles()
{
	form.grdProfiles().getRows().clear();
	clearScreen();//WDEV-14644
	//WDEV-16799
	ProfileShortVoCollection coll = domain.listProfiles((ServiceVo) form.cmbFilterSpecialty().getValue(), form.qmbFilterDirectoryOfService().getValue(), form.cmbHospFilter().getValue(), form.chkActiveOnly().getValue() == false ? null : true, form.chkFilterOutpatients().getValue(), form.chkFilterTheatre().getValue(), form.txtName().getValue(), form.ccListOwner().getValue());
	if (coll == null || coll.size() == 0)
		return;

	GenForm.grdProfilesRow row;
	for (int i = 0; i < coll.size(); i++)
	{
		ProfileShortVo prfile = coll.get(i);
		row = form.grdProfiles().getRows().newRow();
		row.setValue(prfile);
		if (prfile.getEffToIsNotNull())
			row.setcolEndDate(prfile.getEffTo().toString());
		if (prfile.getEffFrmIsNotNull())
			row.setcolStartDate(prfile.getEffFrm().toString());
		row.setcolProfileDescription(prfile.getDescription());
		if (prfile.getServiceIsNotNull())
			row.setcolSpeciality(prfile.getService().getServiceName());
	}
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public void populateScreenFromData(ServiceVo voService, TreeNode node)
{
	// clear out instance data for next edit
	clearInstanceControls();

	super.populateScreenFromData(voService); // do this anyway for
												// ServiceVo info
	cmbCategoryValueChanged();				//wdev-16371

	// additional info for ServiceFunction and ServiceActivity
	// set local context function and activity collections for current
	// service selection
	populateScreenFromDataActivityFunction(node);

	populateScreenFromDataServiceInfo();
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private String formatServicevoTooltip(ServiceVo voService)
{
	String out = makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(true) + ": *", "DarkRed", "tahoma", "14");
	out += makeTextile(voService.getServiceNameIsNotNull() ? voService.getServiceName() : "", "black", "tahoma", "12");
	out += makeNewLine(new Integer(1));
	if (voService.getServiceDescriptionIsNotNull())
	{
		out += makeNewLine(new Integer(1));
		out += makeTextile("*Description: *", "DarkRed", "tahoma", "12");
		out += makeTextile(voService.getServiceDescription(), "black", "tahoma", "12");
	}
	if (voService.getIsActiveIsNotNull())
	{
		out += makeNewLine(new Integer(1));
		out += makeTextile("*Active: *", "DarkRed", "tahoma", "12");
		out += makeTextile(voService.getIsActive().toString(), "black", "tahoma", "12");
	}
	return new TextileString(out).toString();
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public boolean populateActivityFunctionDataFromScreen(ServiceVo voService) throws UniqueKeyViolationException
{
	boolean ret = false;
	if (checkForErrorsOnActivityFunction())
	{
		// update taxonomy contexts for last selected function and activity
		saveServiceActivityTaxonomy(voService);
		saveServiceFunctionTaxonomy(voService);

		// add/remove activities
		ret = saveServiceActivity();
		if (!ret)
			return ret;

		ret = saveServiceFunction();

		return ret;
	}

	return false;
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void treeExpandCollapse(TreeNode node)
{
	if (node.isExpanded())
	{
		if (node.getNodes().size() > 0 && node.getNodes().get(0).getValue() == null)
		{
			if (node.getValue() instanceof ServiceVo)
				form.getLocalContext().setSelectedRecord((ServiceVo) node.getValue());
			populateServiceFunctionAndActivity(node);
		}
	}
	else
	{
		if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
		{
			if (node.getNodes().get(0).getText() == form.getLocalContext().gettreMessage())
			{
				node.getNodes().get(0).setText("Loading Please wait...");
			}
		}
	}
}
 
Example 33
Project: openmaxims-linux   File: LocationServiceImpl.java   Source Code and License 6 votes vote down vote up
/**
 * expects parameters returns null if the parameters are not set
 */
public LocationServiceVoCollection listServicesForLocation(LocationRefVo location, ServiceVo service)
{
	DomainFactory factory = getDomainFactory();

	if (location == null || service == null)
		return null;

	if (location.getID_LocationIsNotNull() && service.getID_ServiceIsNotNull())
	{
		java.util.List servactList = factory.find("from  LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{location.getID_Location(), service.getID_Service()});
		return LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(servactList).sort();
	}

	return null;
}
 
Example 34
Project: openmaxims-linux   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
	LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
	LocationServiceVo voLocSer = new LocationServiceVo();
	voLocSer.setService(voService);
	voLocSer.setIsActive(new Boolean(true));
	LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
	if (voColl != null && voColl.size() > 0)
	{

		String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
		for (int i = 0; i < voColl.size(); i++)
		{
			activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
		}

		return activeMessage;
	}
	else
		return null;
}
 
Example 35
Project: openmaxims-linux   File: ServiceImpl.java   Source Code and License 6 votes vote down vote up
public String isServiceActivityUnique(TaxonomyMapCollection map, ServiceVo voService)
{
	DomainFactory factory = getDomainFactory();

	if (map != null)
	{
		String result = "";
		for (int i = 0; i < map.size(); i++)
		{
			java.util.List list = factory.find("select s1_1.service.id, s2_1.serviceName, t1_1.taxonomyCode, l1_1.id from ServiceActivity as s1_1 left join s1_1.service as s2_1 left join s1_1.taxonomyMap as t1_1 left join t1_1.taxonomyName as l1_1 where (t1_1.taxonomyCode = :code and s2_1.serviceName <> :name and l1_1.id = :id)", new String[]{"code", "name", "id"}, new Object[]{map.get(i).getTaxonomyCode(), voService.getServiceName(), new Integer(map.get(i).getTaxonomyName().getID())});

			if (list.size() != 0 && map.get(i).getTaxonomyCodeIsNotNull())
				result = result + (map.get(i).getTaxonomyCode() + " ");

		}
		return result;
	}

	return "";
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkServiceExists(ServiceShortVo voServiceShort, LocationServiceVo voLocationService)
{
	ServiceVo voService = new ServiceVo();
	voService.setID_Service(voServiceShort.getID_Service());
	voLocationService.setService(voService);
	return (domain.listLocationService(voLocationService).size() > 0);
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException
{
	initalize();
	// Screen called from WorkQueue - display Patient and Case
	if (form.getGlobalContext().NTPF.getTargetObjectIdIsNotNull())
	{
		clearInstanceControls();

		ServiceVo voService = new ServiceVo();
		voService.setID_Service(form.getGlobalContext().NTPF.getTargetObjectId());
		form.getLocalContext().setSelectedRecord(domain.getServiceById(voService));

		if (form.getLocalContext().getSelectedRecordIsNotNull())
		{
			ServiceVoCollection voColl = new ServiceVoCollection();
			voColl.add(form.getLocalContext().getSelectedRecord());
			populateListControl(voColl);
			form.treService().setValue(form.getLocalContext().getSelectedRecord());

			selectionChange(form.treService().getSelectedNode());

			form.treService().getSelectedNode().setExpanded(true);

			treeExpandCollapse(form.treService().getSelectedNode());

		}

		form.getGlobalContext().NTPF.setTargetObjectId(null);

		form.lnkBack().setVisible(true);
		form.getLocalContext().setPreviousForm(getPrevForm());

		return;
	}
	else
		form.lnkBack().setVisible(false);

	open();
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * populates the screen from data from specified Vo Collection
 * 
 * @param ServiceVoCollection
 * @return void
 */
public void populateListControl(ServiceVoCollection voColl)
{
	clear();

	if (voColl == null || voColl.size() == 0)
	{
		engine.showMessage("No results found.");
		return;
	}

	for (int i = 0; i < voColl.size(); i++)
	{
		ServiceVo voService = voColl.get(i);
		if (voService.getServiceNameIsNotNull())
		{
			TreeNode newNode = form.treService().getNodes().add(voService, (voService.getServiceNameIsNotNull() ? voService.getServiceName() : ""));
			newNode.setTooltip(formatServicevoTooltip(voService));
			newNode.setExpandedImage(form.getImages().Admin.Service);
			newNode.setCollapsedImage(form.getImages().Admin.Service);
			newNode.setSelectedImage(form.getImages().Admin.Service);
			if (voService.getIsActiveIsNotNull() && !voService.getIsActive().booleanValue())
				newNode.setTextColor(Color.Red);

			if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
				newNode.getNodes().add(null, "Loading Please wait...");
		}
	}
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setScreenViewMode()
{
	form.setMode(FormMode.VIEW);
	if ((form.treService().getSelectedNode() != null) && (form.treService().getValue() instanceof ServiceVo))
		populateScreenFromData((ServiceVo) form.treService().getValue(), form.treService().getSelectedNode());

}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onGrdActivitySelectionChanged() throws PresentationLogicException
{	
	
	if (form.getLocalContext().getSelectedActivityIsNotNull() && ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (didPreviousDisplayedActivityTaxonomyHaveEXCH(form.getLocalContext().getSelectedActivity()))
		{
			form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().setValue(form.getLocalContext().getSelectedActivity());
			return;
		}
	}
	grdActivityRow row;
	row = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().getSelectedRow();
	
	form.getLocalContext().setSelectedActivity(row.getValue());

	if (form.getLocalContext().getSelectedRecordIsNotNull())
		saveServiceActivityTaxonomy(form.getLocalContext().getSelectedRecord());
	else
		saveServiceActivityTaxonomy(populateDataFromScreen(new ServiceVo()));

	//WDEV-16672
	updateDetailsTabContextMenusState();
	form.getContextMenus().getGenericGridUpdateItem().setText("Edit " + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " Taxonomy");

	form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setEnabled(true);
	form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setReadOnly(false);

	form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().clear();

	ServiceActivityVo vo = inActivityList(row.getValue(), form.getLocalContext().getserviceActivities());

	form.getLocalContext().setSelectedRecordActivity(vo);

	getActivityTaxonomy(vo, true);
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void saveServiceFunctionTaxonomy(ServiceVo voService)
{
	if (voService != null)
	{
		ServiceFunctionVo vo = form.getLocalContext().getSelectedRecordFunction();
		if (vo != null)
		{
			vo.setService(voService);
			vo.setTaxonomyMap(null);
			if (form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().size() > 0)
			{
				TaxonomyMapCollection voColl = new TaxonomyMapCollection();
				// update it's taxonmy
				for (int i = 0; i < form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().size(); i++)
				{
					TaxonomyMap mp = form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).getValue();
					mp.setTaxonomyCode(form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).getcolCode());
					mp.setTaxonomyName(form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).getcolExtCodeType());
					form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).setValue(mp);
					voColl.add(form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).getValue());
				}

				vo.setTaxonomyMap(voColl);

				// update serviceVo
				updateFunctionList(vo);
			}
		}
	}
}
 
Example 42
Project: AvoinApotti   File: LocationServiceImpl.java   Source Code and License 5 votes vote down vote up
public ServiceVo getService(Integer serviceId)
{
	DomainFactory factory = getDomainFactory();

	if (serviceId != null)
	{
		Service domSserv = (Service) factory.getDomainObject(Service.class, serviceId);
		return ServiceVoAssembler.create(domSserv);
	}
	return null;
}
 
Example 43
Project: AvoinApotti   File: ServiceImpl.java   Source Code and License 5 votes vote down vote up
public String checkLSALinks(ServiceActivityVo voServiceActivity) throws DomainInterfaceException
{
	if (voServiceActivity != null)
	{
		// check if an active Location Service Activity records
		LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
		LocationServiceActivityVo voLocSerAct = new LocationServiceActivityVo();
		voLocSerAct.setServiceActivity(voServiceActivity);
		voLocSerAct.setIsActive(new Boolean(true));
		LocationServiceVo voLocSer = new LocationServiceVo();
		ServiceVo voSer = new ServiceVo();
		voSer.setID_Service(voServiceActivity.getService().getID_Service());
		voSer.setIsActive(voServiceActivity.getService().getIsActive());
		voLocSer.setService(voSer);
		voLocSerAct.setLocationService(voLocSer);
		LocationServiceActivityVoCollection voColl = impl.listLocationServiceActivity(voLocSerAct.getLocationService(), voLocSerAct.getServiceActivity().getActivity());
		if (voColl != null && voColl.size() > 0)
		{
			String activeMessage = "The following " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(false) + "," + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + "," + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " links are still active.\r\n";
			for (int j = 0; j < voColl.size(); j++)
			{
				activeMessage += "\r\n" + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(false) + " : " + (voColl.get(j).getLocationService().getLocation().getNameIsNotNull() ? voColl.get(j).getLocationService().getLocation().getName() : "");
				activeMessage += "  " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + (voColl.get(j).getLocationService().getService().getServiceNameIsNotNull() ? voColl.get(j).getLocationService().getService().getServiceName() : "");
				for (int k = 0; k < voColl.get(j).getLocationService().getActivities().size(); k++)
				{
					if (voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivityIsNotNull())
					{
						activeMessage += "\r\n" + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " : " + (voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivity().getNameIsNotNull() ? voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivity().getName() : "");
					}
				}
			}
			return activeMessage;
		}
	}

	return null;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * Function used to determine if the modality has changed
 * It will analyse the first investigation from the new order with the investigation to amend.
 * If in either investigation the modality can not be reached it will consider that modality has changed
 */
private boolean hasModalityChanged(OcsOrderVo newOrder, OrderInvestigationLiteVo investigationToAmend)
{
	// Check new order for investigations
	if (newOrder == null || newOrder.getInvestigations() == null || newOrder.getInvestigations().size() == 0)
		return true;

	OrderInvestigationVo investigation = newOrder.getInvestigations().get(0);

	// Check first OrderInvestigation for modality (Speciality in the Investigation.ProviderService.LocationService.Service)
	// If the modality can not be retrieved - consider that the modality has changed
	if (investigation == null || investigation.getInvestigation() == null || investigation.getInvestigation().getProviderService() == null || investigation.getInvestigation().getProviderService().getLocationService() == null || investigation.getInvestigation().getProviderService().getLocationService().getService() == null)
		return true;

	ServiceVo newModality = investigation.getInvestigation().getProviderService().getLocationService().getService();

	// Check modality for OrderInvestigation to amend
	if (investigationToAmend == null || investigationToAmend.getInvestigation() == null || investigationToAmend.getInvestigation().getProviderService() == null || investigationToAmend.getInvestigation().getProviderService().getLocationService() == null || investigationToAmend.getInvestigation().getProviderService().getLocationService().getService() == null)
		return true;

	ServiceLiteVo oldModality = investigationToAmend.getInvestigation().getProviderService().getLocationService().getService();

	// Keep in mind that the objects are of different types (cast is only to point this out)
	// and use the root of them as base for equals
	if (oldModality.equals((ServiceLiteVo)newModality))
		return false;

	return true;
}
 
Example 45
Project: AvoinApotti   File: ReferralOutcomeComponentImpl.java   Source Code and License 5 votes vote down vote up
public ServiceVo getCatsReferralService(CatsReferralRefVo voCatsReferralRef) 
{
	CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, voCatsReferralRef.getID_CatsReferral()));
	if (voCatsReferral != null
		&& voCatsReferral.getReferralDetailsIsNotNull()
		&& voCatsReferral.getReferralDetails().getServiceIsNotNull())
		return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service()));

	return null;
}
 
Example 46
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void searchProfiles(boolean fromBtn)
{
	form.grdProfiles().getRows().clear();
	form.grdProfiles().setValue(null); //WDEV-21641
	if (fromBtn)
	{	
		form.getLocalContext().setSelectedRecord(null);//WDEV-21641
	}
	
	ProfileShortVoCollection coll = domain.listProfiles(form.txtName().getValue(),(ServiceVo) form.cmbFilterSpecialty().getValue(),form.cmbHospFilter().getValue(), form.ccListOwner().getValue(), true, true);	
	if (coll == null || coll.size() == 0)
	{
		form.grdProfiles().setValue(form.getLocalContext().getSelectedRecord()); //WDEV-21641
		updateControlState(); //WDEV-21641
		return;
	}
	
	for (int i = 0; i < coll.size(); i++)
	{
		ProfileShortVo profile = coll.get(i);
		addRow(profile);
		
	}
	
	form.grdProfiles().setValue(form.getLocalContext().getSelectedRecord()); //WDEV-21641

	updateControlState(); //WDEV-21641
}
 
Example 47
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void searchProfiles(boolean fromBtn)
{
	form.grdProfiles().getRows().clear();
	if (fromBtn)
	{	
		form.getLocalContext().setCurrentProfile(null);
	}
	clearScreen();//WDEV-14644
	//WDEV-16799
	ProfileShortVoCollection coll = domain.listProfiles((ServiceVo) form.cmbFilterSpecialty().getValue(), form.qmbFilterDirectoryOfService().getValue(), form.cmbHospFilter().getValue(), form.chkActiveOnly().getValue() == false ? null : true, form.chkFilterOutpatients().getValue(), form.chkFilterTheatre().getValue(), form.txtName().getValue(), form.ccListOwner().getValue(),form.chkFilterWardAttendance().getValue());	//wdev-20074
	if (coll == null || coll.size() == 0)
		return;
	
	//wdev-20074
	if (form.getLocalContext().getCurrentProfile() != null && form.getLocalContext().getCurrentProfile().getID_Sch_Profile() != null)
	{
		if( !coll.contains(form.getLocalContext().getCurrentProfile()))
			form.getLocalContext().setCurrentProfile(null);
	}
	else
	{
		form.getLocalContext().setCurrentProfile(null);
	}

	GenForm.grdProfilesRow row;
	for (int i = 0; i < coll.size(); i++)
	{
		ProfileShortVo prfile = coll.get(i);
		row = form.grdProfiles().getRows().newRow();
		row.setValue(prfile);
		if (prfile.getEffToIsNotNull())
			row.setcolEndDate(prfile.getEffTo().toString());
		if (prfile.getEffFrmIsNotNull())
			row.setcolStartDate(prfile.getEffFrm().toString());
		row.setcolProfileDescription(prfile.getDescription());
		if (prfile.getServiceIsNotNull())
			row.setcolSpeciality(prfile.getService().getServiceName());
	}
}
 
Example 48
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkServiceExists(ServiceShortVo voServiceShort, LocationServiceVo voLocationService)
{
	ServiceVo voService = new ServiceVo();
	voService.setID_Service(voServiceShort.getID_Service());
	voLocationService.setService(voService);
	return (domain.listLocationService(voLocationService).size() > 0);
}
 
Example 49
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateScreenFromData(ServiceVo service)
{
	populateServiceDetails(service);
	populateActivityAndFunction();
	
	if(form.lyrService().tabServiceandFunctionsbyHCP().isVisible())
	{
		populateServiceAndFunctionByHcp();
	}
	
	populateTriageActions();
	populateServiceDiagnostics();
}
 
Example 50
Project: openMAXIMS   File: LocationServiceImpl.java   Source Code and License 5 votes vote down vote up
public ServiceVo getService(Integer serviceId)
{
	DomainFactory factory = getDomainFactory();

	if (serviceId != null)
	{
		Service domSserv = (Service) factory.getDomainObject(Service.class, serviceId);
		return ServiceVoAssembler.create(domSserv);
	}
	return null;
}
 
Example 51
Project: openMAXIMS   File: ServiceImpl.java   Source Code and License 5 votes vote down vote up
public String checkLSALinks(ServiceActivityVo voServiceActivity) throws DomainInterfaceException
{
	if (voServiceActivity != null)
	{
		// check if an active Location Service Activity records
		LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
		LocationServiceActivityVo voLocSerAct = new LocationServiceActivityVo();
		voLocSerAct.setServiceActivity(voServiceActivity);
		voLocSerAct.setIsActive(new Boolean(true));
		LocationServiceVo voLocSer = new LocationServiceVo();
		ServiceVo voSer = new ServiceVo();
		voSer.setID_Service(voServiceActivity.getService().getID_Service());
		voSer.setIsActive(voServiceActivity.getService().getIsActive());
		voLocSer.setService(voSer);
		voLocSerAct.setLocationService(voLocSer);
		LocationServiceActivityVoCollection voColl = impl.listLocationServiceActivity(voLocSerAct.getLocationService(), voLocSerAct.getServiceActivity().getActivity());
		if (voColl != null && voColl.size() > 0)
		{
			String activeMessage = "The following " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(false) + "," + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + "," + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " links are still active.\r\n";
			for (int j = 0; j < voColl.size(); j++)
			{
				activeMessage += "\r\n" + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(false) + " : " + (voColl.get(j).getLocationService().getLocation().getNameIsNotNull() ? voColl.get(j).getLocationService().getLocation().getName() : "");
				activeMessage += "  " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + (voColl.get(j).getLocationService().getService().getServiceNameIsNotNull() ? voColl.get(j).getLocationService().getService().getServiceName() : "");
				for (int k = 0; k < voColl.get(j).getLocationService().getActivities().size(); k++)
				{
					if (voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivityIsNotNull())
					{
						activeMessage += "\r\n" + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " : " + (voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivity().getNameIsNotNull() ? voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivity().getName() : "");
					}
				}
			}
			return activeMessage;
		}
	}

	return null;
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * Function used to determine if the modality has changed
 * It will analyse the first investigation from the new order with the investigation to amend.
 * If in either investigation the modality can not be reached it will consider that modality has changed
 */
private boolean hasModalityChanged(OcsOrderVo newOrder, OrderInvestigationLiteVo investigationToAmend)
{
	// Check new order for investigations
	if (newOrder == null || newOrder.getInvestigations() == null || newOrder.getInvestigations().size() == 0)
		return true;

	OrderInvestigationVo investigation = newOrder.getInvestigations().get(0);

	// Check first OrderInvestigation for modality (Speciality in the Investigation.ProviderService.LocationService.Service)
	// If the modality can not be retrieved - consider that the modality has changed
	if (investigation == null || investigation.getInvestigation() == null || investigation.getInvestigation().getProviderService() == null || investigation.getInvestigation().getProviderService().getLocationService() == null || investigation.getInvestigation().getProviderService().getLocationService().getService() == null)
		return true;

	ServiceVo newModality = investigation.getInvestigation().getProviderService().getLocationService().getService();

	// Check modality for OrderInvestigation to amend
	if (investigationToAmend == null || investigationToAmend.getInvestigation() == null || investigationToAmend.getInvestigation().getProviderService() == null || investigationToAmend.getInvestigation().getProviderService().getLocationService() == null || investigationToAmend.getInvestigation().getProviderService().getLocationService().getService() == null)
		return true;

	ServiceLiteVo oldModality = investigationToAmend.getInvestigation().getProviderService().getLocationService().getService();

	// Keep in mind that the objects are of different types (cast is only to point this out)
	// and use the root of them as base for equals
	if (oldModality.equals((ServiceLiteVo)newModality))
		return false;

	return true;
}
 
Example 53
Project: openMAXIMS   File: ReferralOutcomeComponentImpl.java   Source Code and License 5 votes vote down vote up
public ServiceVo getCatsReferralService(CatsReferralRefVo voCatsReferralRef) 
{
	CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, voCatsReferralRef.getID_CatsReferral()));
	if (voCatsReferral != null
		&& voCatsReferral.getReferralDetailsIsNotNull()
		&& voCatsReferral.getReferralDetails().getServiceIsNotNull())
		return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service()));

	return null;
}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkServiceExists(ServiceShortVo voServiceShort, LocationServiceVo voLocationService)
{
	ServiceVo voService = new ServiceVo();
	voService.setID_Service(voServiceShort.getID_Service());
	voLocationService.setService(voService);
	return (domain.listLocationService(voLocationService).size() > 0);
}
 
Example 55
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException
{
	initalize();
	// Screen called from WorkQueue - display Patient and Case
	if (form.getGlobalContext().NTPF.getTargetObjectIdIsNotNull())
	{
		clearInstanceControls();

		ServiceVo voService = new ServiceVo();
		voService.setID_Service(form.getGlobalContext().NTPF.getTargetObjectId());
		form.getLocalContext().setSelectedRecord(domain.getServiceById(voService));

		if (form.getLocalContext().getSelectedRecordIsNotNull())
		{
			ServiceVoCollection voColl = new ServiceVoCollection();
			voColl.add(form.getLocalContext().getSelectedRecord());
			populateListControl(voColl);
			form.treService().setValue(form.getLocalContext().getSelectedRecord());

			selectionChange(form.treService().getSelectedNode());

			form.treService().getSelectedNode().setExpanded(true);

			treeExpandCollapse(form.treService().getSelectedNode());

		}

		form.getGlobalContext().NTPF.setTargetObjectId(null);

		form.lnkBack().setVisible(true);
		form.getLocalContext().setPreviousForm(getPrevForm());

		return;
	}
	else
		form.lnkBack().setVisible(false);

	open();
}
 
Example 56
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * populates the screen from data from specified Vo Collection
 * 
 * @param ServiceVoCollection
 * @return void
 */
public void populateListControl(ServiceVoCollection voColl)
{
	clear();

	if (voColl == null || voColl.size() == 0)
	{
		engine.showMessage("No results found.");
		return;
	}

	for (int i = 0; i < voColl.size(); i++)
	{
		ServiceVo voService = voColl.get(i);
		if (voService.getServiceNameIsNotNull())
		{
			TreeNode newNode = form.treService().getNodes().add(voService, (voService.getServiceNameIsNotNull() ? voService.getServiceName() : ""));
			newNode.setTooltip(formatServicevoTooltip(voService));
			newNode.setExpandedImage(form.getImages().Admin.Service);
			newNode.setCollapsedImage(form.getImages().Admin.Service);
			newNode.setSelectedImage(form.getImages().Admin.Service);
			if (voService.getIsActiveIsNotNull() && !voService.getIsActive().booleanValue())
				newNode.setTextColor(Color.Red);

			if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
				newNode.getNodes().add(null, "Loading Please wait...");
		}
	}
}
 
Example 57
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setScreenViewMode()
{
	form.setMode(FormMode.VIEW);
	if ((form.treService().getSelectedNode() != null) && (form.treService().getValue() instanceof ServiceVo))
		populateScreenFromData((ServiceVo) form.treService().getValue(), form.treService().getSelectedNode());

}
 
Example 58
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onGrdActivitySelectionChanged() throws PresentationLogicException
{	
	
	if (form.getLocalContext().getSelectedActivityIsNotNull() && ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
	{
		if (didPreviousDisplayedActivityTaxonomyHaveEXCH(form.getLocalContext().getSelectedActivity()))
		{
			form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().setValue(form.getLocalContext().getSelectedActivity());
			return;
		}
	}
	grdActivityRow row;
	row = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().getSelectedRow();
	
	form.getLocalContext().setSelectedActivity(row.getValue());

	if (form.getLocalContext().getSelectedRecordIsNotNull())
		saveServiceActivityTaxonomy(form.getLocalContext().getSelectedRecord());
	else
		saveServiceActivityTaxonomy(populateDataFromScreen(new ServiceVo()));

	//WDEV-16672
	updateDetailsTabContextMenusState();
	form.getContextMenus().getGenericGridUpdateItem().setText("Edit " + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " Taxonomy");

	form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setEnabled(true);
	form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setReadOnly(false);

	form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().clear();

	ServiceActivityVo vo = inActivityList(row.getValue(), form.getLocalContext().getserviceActivities());

	form.getLocalContext().setSelectedRecordActivity(vo);

	getActivityTaxonomy(vo, true);
}
 
Example 59
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void saveServiceFunctionTaxonomy(ServiceVo voService)
{
	if (voService != null)
	{
		ServiceFunctionVo vo = form.getLocalContext().getSelectedRecordFunction();
		if (vo != null)
		{
			vo.setService(voService);
			vo.setTaxonomyMap(null);
			if (form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().size() > 0)
			{
				TaxonomyMapCollection voColl = new TaxonomyMapCollection();
				// update it's taxonmy
				for (int i = 0; i < form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().size(); i++)
				{
					TaxonomyMap mp = form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).getValue();
					mp.setTaxonomyCode(form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).getcolCode());
					mp.setTaxonomyName(form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).getcolExtCodeType());
					form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).setValue(mp);
					voColl.add(form.lyr1().Edit().lyrActivityFunction().tabPageFunction().grdFunctionTaxonomy().getRows().get(i).getValue());
				}

				vo.setTaxonomyMap(voColl);

				// update serviceVo
				updateFunctionList(vo);
			}
		}
	}
}
 
Example 60
Project: openMAXIMS   File: LocationServiceImpl.java   Source Code and License 5 votes vote down vote up
public ServiceVo getService(Integer serviceId)
{
	DomainFactory factory = getDomainFactory();

	if (serviceId != null)
	{
		Service domSserv = (Service) factory.getDomainObject(Service.class, serviceId);
		return ServiceVoAssembler.create(domSserv);
	}
	return null;
}