Java Code Examples for ims.core.vo.lookups.ChannelType

The following are top voted examples for showing how to use ims.core.vo.lookups.ChannelType. 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: openmaxims-linux   File: Logic.java   View source code 7 votes vote down vote up
private CommChannelVo getCommChannel(ChannelType channelType, Object channelValue, CommChannelVoCollection commChannelVoCollection) 
{
	if(commChannelVoCollection == null)
		return null;
	
	if(channelType == null || channelValue == null)
		return null;
	
	for(CommChannelVo channel : commChannelVoCollection)
	{
		if(channel == null)
			continue;
		
		if(channel.getChannelType().equals(channelType) && channel.getCommValue().equals(channelValue))
			return channel;
	}
	
	return null;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
public void populateScreenFromData(PersonAddress pa)
{
	if (pa != null)
	{
		pa.setPhone(pa.getPhone());

		if (form.getGlobalContext().Core.getPatientShortIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null)
			pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue());
		
		form.ccAddress().setValue(pa);
		form.txtOtherPhone().setValue(pa.getOtherphone());
		form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null);
		form.getLocalContext().setpersonAddress(pa);
	}
	form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex());
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void doCopy()
{
	clearAddressControls();
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
		
		//start WDEV-14370
		if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
		{
			personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
		}
		//end
		
		form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432
		
		populateScreenFromData(personAddress);
		displayPhoneNumbers();
		
		form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private String getTelephone(GpLiteVo gp)
{
	if (gp == null)
		return null;
	if (!gp.getCommChannelsIsNotNull())
		return null;
	for (int i = 0 ; i < gp.getCommChannels().size() ; i++)
	{
		CommChannelVo commChannelVo = gp.getCommChannels().get(i);
		if (ChannelType.GEN_PHONE.equals(commChannelVo.getChannelType()) || 
				ChannelType.HOME_PHONE.equals(commChannelVo.getChannelType()) ||
				ChannelType.WORK_PHONE.equals(commChannelVo.getChannelType()) ||
				ChannelType.MOBILE.equals(commChannelVo.getChannelType()))
				return commChannelVo.getCommValue();
	}	
	return null;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private String getGpMailAddress(GpLiteVo patientGp)
{
	if (patientGp == null)
		return null;

	String mail = null;

	if (patientGp.getCommChannelsIsNotNull())
	{
		for (int i = 0; i < patientGp.getCommChannels().size(); i++)
		{
			if (patientGp.getCommChannels().get(i) == null)
				continue;

			if (ChannelType.EMAIL.equals(patientGp.getCommChannels().get(i).getChannelType()) && patientGp.getCommChannels().get(i).getCommValue() != null)
			{
				mail = patientGp.getCommChannels().get(i).getCommValue();
			}
		}
	}

	return mail;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private CommChannelVo getCommChannel(ChannelType channelType, Object channelValue, CommChannelVoCollection commChannelVoCollection) 
{
	if(commChannelVoCollection == null)
		return null;
	
	if(channelType == null || channelValue == null)
		return null;
	
	for(CommChannelVo channel : commChannelVoCollection)
	{
		if(channel == null)
			continue;
		
		if(channel.getChannelType().equals(channelType) && channel.getCommValue().equals(channelValue))
			return channel;
	}
	
	return null;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnUpdateClick() throws PresentationLogicException
{
	// AppUserVo user = domain.getAppUser(form.grdAppUsers().getValue());
	// form.getLocalContext().setAppUserVo(user);
	form.setMode(FormMode.EDIT);
	form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
	form.btnUpdate().setEnabled(false);
	if (form.getLocalContext().getAppUserVoIsNotNull())
		if (form.getLocalContext().getAppUserVo().getMosIsNotNull())
			if (form.getLocalContext().getAppUserVo().getMos().getCommChannelsIsNotNull())
				for (int i=0;i<form.getLocalContext().getAppUserVo().getMos().getCommChannels().size();i++)
				{
					if (form.getLocalContext().getAppUserVo().getMos().getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL))
					{
						
						form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo()));
					}
				}
	
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbMosValueChanged() throws PresentationLogicException 
{
	if (form.qmbMos().getValue()!=null)
	{
		MemberOfStaffShortVo mos = form.qmbMos().getValue();
		if (mos.getCommChannelsIsNotNull())
			for (int i=0;i<mos.getCommChannels().size();i++)
			{
				if (mos.getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL))
				{
					form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo()));
				}
			}
		form.lnkEmailAccountInfo().setEnabled(true);
	}
	
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void checkIfCheckBoxShouldBeDisplayedAnyway(DischargeReadyToLeaveVo voReady) 
{
	GP voGP = domain.getPatientsGP(form.getGlobalContext().Core.getPatientShort());
	boolean hasEmail = false;
	if (voGP != null && voGP.getCommChannel(ChannelType.EMAIL) != null)
		hasEmail = true;
		
	DischargeDetailsVo volocalDD = domain.getDischargeDetails(form.getGlobalContext().Core.getCurrentCareContext());
	form.getLocalContext().setCurrentDischargeDetailsVo(volocalDD);

	if ( !hasEmail
		&& volocalDD != null
		&& volocalDD.getDischargeLetterStatusIsNotNull()
		&& volocalDD.getDischargeLetterStatus().equals(DischargeLetterStatus.GENERATED)
		&& (voReady.getHasPatientReceivedCopyOfDischarge() == null
				|| (voReady.getHasPatientReceivedCopyOfDischargeIsNotNull()	&&  ! voReady.getHasPatientReceivedCopyOfDischarge()) ) )
	{
		form.chkLetterGiven().setVisible(true);
		form.lblLetterGiven().setVisible(true);
		
		if (form.getMode().equals(FormMode.EDIT))
			form.chkLetterGiven().setEnabled(true);
	}
	
}
 
Example 10
Project: AvoinApotti   File: EDischargePatientReadyToLeaveSTHKComponentImpl.java   View source code 6 votes vote down vote up
public String getDisplayStringAfterSave(SummaryRefVo summaryId)
{
	//Get number of incomplete sections
	String hql = "select count (detail.id) from Summary as summa left join summa.summaryDetails as detail where " +
			"(summa.id = :summaryId and detail.progressStatus.id <> :progressId and summa.isRIE is null and detail.isRIE is null)";
	DomainFactory df = getDomainFactory();
	long noOfNotCompleted = df.countWithHQL(hql, new String[] {"summaryId","progressId"}, new Object[]{summaryId.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID()});
	if (noOfNotCompleted > 0)
		return null;
	
	//Get GP's email
	hql = "select comm.commValue from Summary as summary left join summary.careContext as cc left join cc.episodeOfCare as eoc " +
			"left join eoc.careSpell as cs left join cs.patient as pat left join pat.gp as gp " +
			"left join gp.commChannels as comm left join comm.channelType as chanType where (summary.id = :summId and chanType.id = :emailId)"; 
	List<?> find = df.find(hql,new String[]{"summId","emailId"},new Object[]{summaryId.getID_Summary(),ChannelType.EMAIL.getID()});
	if (find!=null && find.size() > 0)
	{
		if (find.get(0) instanceof String)
		{
			String email = (String) find.get(0);
			if (email.trim().length()>0)
				return "Discharge Summary Sent to GP";
		}
	}
	return "Discharge Summary Sent to Print";
}
 
Example 11
Project: openMAXIMS   File: EDDischargeDetailsJobImpl.java   View source code 6 votes vote down vote up
private String getGpMail(GPLiteWithCommChannelsVo gp) 
{
	if(gp == null || gp.getCommChannels() == null)
		return null;
	
	for(CommChannelVo channel : gp.getCommChannels())
	{
		if(channel == null)
			continue;
		
		if(ChannelType.EMAIL.equals(channel.getChannelType()))
			return channel.getCommValue();
	}
	
	return null;
}
 
Example 12
Project: openMAXIMS   File: EDEmpDischargeDetailsJobImpl.java   View source code 6 votes vote down vote up
private String getGpMail(GPLiteWithCommChannelsVo gp) 
{
	if(gp == null || gp.getCommChannels() == null)
		return null;
	
	for(CommChannelVo channel : gp.getCommChannels())
	{
		if(channel == null)
			continue;
		
		if(ChannelType.EMAIL.equals(channel.getChannelType()))
			return channel.getCommValue();
	}
	
	return null;
}
 
Example 13
Project: openMAXIMS   File: EDSupplementaryDischargeLetterJobImpl.java   View source code 6 votes vote down vote up
private String getGpMail(GPLiteWithCommChannelsVo gp) 
{
	if(gp == null || gp.getCommChannels() == null)
		return null;
	
	for(CommChannelVo channel : gp.getCommChannels())
	{
		if(channel == null)
			continue;
		
		if(ChannelType.EMAIL.equals(channel.getChannelType()))
			return channel.getCommValue();
	}
	
	return null;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public void populateScreenFromData(PersonAddress pa)
{
	if (pa != null)
	{
		pa.setPhone(pa.getPhone());

		if (form.getGlobalContext().Core.getPatientShortIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null)
			pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue());
		
		form.ccAddress().setValue(pa);
		form.txtOtherPhone().setValue(pa.getOtherphone());
		form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null);
		form.getLocalContext().setpersonAddress(pa);
		
		form.ccEffectiveDates().setEffectiveDates(pa.getBeffdate(), pa.getBetdate());
	}
	form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex());
}
 
Example 15
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void doCopy()
{
	clearAddressControls();
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
		
		//start WDEV-14370
		//if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
		{
			personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
		}
		//end
		
		form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432
		
		populateScreenFromData(personAddress);
		//displayPhoneNumbers();
		
		form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432
	}
}
 
Example 16
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateCommChannels()
{
	//WDEV-22806 - only for SVUH - 	IMS pre-populate three phone numbers Home (Mandatory), Mobile (Mandatory), Work (SVUH to confirm) 
	if (form.getMode().equals(FormMode.EDIT) && ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("IRISH") && form.grdCommChannels().getRows().size() == 0)
	{
		grdCommChannelsRow rowCommChannel = form.grdCommChannels().getRows().newRow();
		rowCommChannel.setcolType(ChannelType.MOBILE);
		rowCommChannel.setValue(new CommChannelVo());
		rowCommChannel = form.grdCommChannels().getRows().newRow();
		rowCommChannel.setcolType(ChannelType.HOME_PHONE);
		rowCommChannel.setValue(new CommChannelVo());
		rowCommChannel = form.grdCommChannels().getRows().newRow();
		rowCommChannel.setcolType(ChannelType.WORK_PHONE);
		rowCommChannel.setValue(new CommChannelVo());
	}
}
 
Example 17
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getTelephone(GpLiteVo gp)
{
	if (gp == null)
		return null;
	if (!gp.getCommChannelsIsNotNull())
		return null;
	for (int i = 0 ; i < gp.getCommChannels().size() ; i++)
	{
		CommChannelVo commChannelVo = gp.getCommChannels().get(i);
		if (ChannelType.GEN_PHONE.equals(commChannelVo.getChannelType()) || 
				ChannelType.HOME_PHONE.equals(commChannelVo.getChannelType()) ||
				ChannelType.WORK_PHONE.equals(commChannelVo.getChannelType()) ||
				ChannelType.MOBILE.equals(commChannelVo.getChannelType()))
				return commChannelVo.getCommValue();
	}	
	return null;
}
 
Example 18
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getGpMailAddress(GpLiteVo patientGp)
{
	if (patientGp == null)
		return null;

	String mail = null;

	if (patientGp.getCommChannelsIsNotNull())
	{
		for (int i = 0; i < patientGp.getCommChannels().size(); i++)
		{
			if (patientGp.getCommChannels().get(i) == null)
				continue;

			if (ChannelType.EMAIL.equals(patientGp.getCommChannels().get(i).getChannelType()) && patientGp.getCommChannels().get(i).getCommValue() != null)
			{
				mail = patientGp.getCommChannels().get(i).getCommValue();
			}
		}
	}

	return mail;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private CommChannelVo getCommChannel(ChannelType channelType, Object channelValue, CommChannelVoCollection commChannelVoCollection) 
{
	if(commChannelVoCollection == null)
		return null;
	
	if(channelType == null || channelValue == null)
		return null;
	
	for(CommChannelVo channel : commChannelVoCollection)
	{
		if(channel == null)
			continue;
		
		if(channel.getChannelType().equals(channelType) && channel.getCommValue().equals(channelValue))
			return channel;
	}
	
	return null;
}
 
Example 20
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void addChannel()
{
	DynamicGridRow parent = form.dyngrdComTypeUsage().getSelectedRow();
	if (parent.getValue() instanceof ChannelType)
		parent = parent.getParent();
	
	if(remainingChannelsType(parent) == 0)
	{
		engine.showMessage("No Channel Type available.", "Warning", MessageButtons.OK, MessageIcon.WARNING);
		return;
	}
	
	DynamicGridRow newRow = addContactTypeToGrid(parent);
	newRow.setValue(new ChannelType());
	
	form.dyngrdComTypeUsage().setSelectedRow(newRow);
	
	form.getLocalContext().setCurrentEditUsage(getUsageParent(parent));
	form.getLocalContext().getCurrentEditUsage().setExpanded(true,true);
	
	rebindAllGridComboBoxes(parent);
	form.dyngrdComTypeUsage().setValue(null);
	updateControlsStatus();
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onDyngrdComTypeUsageCellValueChanged(DynamicGridCell cell)
{
	form.dyngrdComTypeUsage().setValue(null);
	if(Boolean.TRUE.equals(cell.getValue()))
	{
		selectDefaultChannelType(cell.getRow().getParent());
		cell.setValue(true);
	}
	
	if (cell.getRow().getValue() instanceof ChannelType)
	{
		rebindAllGridComboBoxes(cell.getRow().getParent());
		updateControlsStatus();
	}
	
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnUpdateClick() throws PresentationLogicException
{
	// AppUserVo user = domain.getAppUser(form.grdAppUsers().getValue());
	// form.getLocalContext().setAppUserVo(user);
	form.setMode(FormMode.EDIT);
	form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
	form.getContextMenus().getGenericGridReplaceItem().setVisible(false);
	if (form.getLocalContext().getAppUserVoIsNotNull())
		if (form.getLocalContext().getAppUserVo().getMosIsNotNull())
			if (form.getLocalContext().getAppUserVo().getMos().getCommChannelsIsNotNull())
				for (int i=0;i<form.getLocalContext().getAppUserVo().getMos().getCommChannels().size();i++)
				{
					if (form.getLocalContext().getAppUserVo().getMos().getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL))
					{
						
						form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo()));
					}
				}
	
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbMosValueChanged() throws PresentationLogicException 
{
	if (form.qmbMos().getValue()!=null)
	{
		MemberOfStaffShortVo mos = form.qmbMos().getValue();
		if (mos.getCommChannelsIsNotNull())
			for (int i=0;i<mos.getCommChannels().size();i++)
			{
				if (mos.getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL))
				{
					form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo()));
				}
			}
		form.lnkEmailAccountInfo().setEnabled(true);
	}
	
}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String populatePhoneNumbers(PatientShort clientParent, ChannelType channelType) 
{
	if(clientParent == null || !clientParent.getCommChannelsIsNotNull())
		return null;
	
	for(int i=0; i<clientParent.getCommChannels().size(); i++)
	{	
		if(clientParent.getCommChannels().get(i) != null && clientParent.getCommChannels().get(i).getChannelTypeIsNotNull() && clientParent.getCommChannels().get(i).getChannelType().equals(channelType))
		{
			
			return clientParent.getCommChannels().get(i).getCommValue();
		}
	}
	
	return null;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private CommChannelVoCollection getCommChannels() 
{
	if(!form.chkHome().getValue() && !form.chkMobile().getValue())
		return null;
	
	CommChannelVoCollection clientCommChannels = new CommChannelVoCollection();
	
	if(form.chkHome().getValue() && form.txtHomePhone().getValue() != null && this.form.txtHomePhone().getValue().trim().length() > 0)
	{
		CommChannelVo clientHomePhone = new CommChannelVo();
		clientHomePhone.setChannelType(ChannelType.HOME_PHONE);
		clientHomePhone.setCommValue(this.form.txtHomePhone().getValue());
		clientCommChannels.add(clientHomePhone);
	}
	if(form.chkMobile().getValue() && this.form.txtMobilePhone().getValue() != null && this.form.txtMobilePhone().getValue().trim().length() > 0)
	{
		CommChannelVo clientMobilePhone = new CommChannelVo();
		clientMobilePhone.setChannelType(ChannelType.MOBILE);
		clientMobilePhone.setCommValue(this.form.txtMobilePhone().getValue());
		clientCommChannels.add(clientMobilePhone);
	}
	
	return clientCommChannels;
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void checkIfCheckBoxShouldBeDisplayedAnyway(DischargeReadyToLeaveVo voReady) 
{
	GP voGP = domain.getPatientsGP(form.getGlobalContext().Core.getPatientShort());
	boolean hasEmail = false;
	if (voGP != null && voGP.getCommChannel(ChannelType.EMAIL) != null)
		hasEmail = true;
		
	DischargeDetailsVo volocalDD = domain.getDischargeDetails(form.getGlobalContext().Core.getCurrentCareContext());
	form.getLocalContext().setCurrentDischargeDetailsVo(volocalDD);

	if ( !hasEmail
		&& volocalDD != null
		&& volocalDD.getDischargeLetterStatusIsNotNull()
		&& volocalDD.getDischargeLetterStatus().equals(DischargeLetterStatus.GENERATED)
		&& (voReady.getHasPatientReceivedCopyOfDischarge() == null
				|| (voReady.getHasPatientReceivedCopyOfDischargeIsNotNull()	&&  ! voReady.getHasPatientReceivedCopyOfDischarge()) ) )
	{
		form.chkLetterGiven().setVisible(true);
		form.lblLetterGiven().setVisible(true);
		
		if (form.getMode().equals(FormMode.EDIT))
			form.chkLetterGiven().setEnabled(true);
	}
	
}
 
Example 27
Project: openMAXIMS   File: EDischargePatientReadyToLeaveSTHKComponentImpl.java   View source code 6 votes vote down vote up
public String getDisplayStringAfterSave(SummaryRefVo summaryId)
{
	//Get number of incomplete sections
	String hql = "select count (detail.id) from Summary as summa left join summa.summaryDetails as detail where " +
			"(summa.id = :summaryId and detail.progressStatus.id <> :progressId and summa.isRIE is null and detail.isRIE is null)";
	DomainFactory df = getDomainFactory();
	long noOfNotCompleted = df.countWithHQL(hql, new String[] {"summaryId","progressId"}, new Object[]{summaryId.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID()});
	if (noOfNotCompleted > 0)
		return null;
	
	//Get GP's email
	hql = "select comm.commValue from Summary as summary left join summary.careContext as cc left join cc.episodeOfCare as eoc " +
			"left join eoc.careSpell as cs left join cs.patient as pat left join pat.gp as gp " +
			"left join gp.commChannels as comm left join comm.channelType as chanType where (summary.id = :summId and chanType.id = :emailId)"; 
	List<?> find = df.find(hql,new String[]{"summId","emailId"},new Object[]{summaryId.getID_Summary(),ChannelType.EMAIL.getID()});
	if (find!=null && find.size() > 0)
	{
		if (find.get(0) instanceof String)
		{
			String email = (String) find.get(0);
			if (email.trim().length()>0)
				return "Discharge Summary Sent to GP";
		}
	}
	return "Discharge Summary Sent to Print";
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
public void populateScreenFromData(PersonAddress pa)
{
	if (pa != null)
	{
		pa.setPhone(pa.getPhone());

		if (form.getGlobalContext().Core.getPatientShortIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null)
			pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue());
		
		form.ccAddress().setValue(pa);
		form.txtOtherPhone().setValue(pa.getOtherphone());
		form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null);
		form.getLocalContext().setpersonAddress(pa);
	}
	form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex());
}
 
Example 29
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void doCopy()
{
	clearAddressControls();
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
		
		//start WDEV-14370
		if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
		{
			personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
		}
		//end
		
		form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432
		
		populateScreenFromData(personAddress);
		displayPhoneNumbers();
		
		form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432
	}
}
 
Example 30
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getTelephone(GpLiteVo gp)
{
	if (gp == null)
		return null;
	if (!gp.getCommChannelsIsNotNull())
		return null;
	for (int i = 0 ; i < gp.getCommChannels().size() ; i++)
	{
		CommChannelVo commChannelVo = gp.getCommChannels().get(i);
		if (ChannelType.GEN_PHONE.equals(commChannelVo.getChannelType()) || 
				ChannelType.HOME_PHONE.equals(commChannelVo.getChannelType()) ||
				ChannelType.WORK_PHONE.equals(commChannelVo.getChannelType()) ||
				ChannelType.MOBILE.equals(commChannelVo.getChannelType()))
				return commChannelVo.getCommValue();
	}	
	return null;
}
 
Example 31
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getGpMailAddress(GpLiteVo patientGp)
{
	if (patientGp == null)
		return null;

	String mail = null;

	if (patientGp.getCommChannelsIsNotNull())
	{
		for (int i = 0; i < patientGp.getCommChannels().size(); i++)
		{
			if (patientGp.getCommChannels().get(i) == null)
				continue;

			if (ChannelType.EMAIL.equals(patientGp.getCommChannels().get(i).getChannelType()) && patientGp.getCommChannels().get(i).getCommValue() != null)
			{
				mail = patientGp.getCommChannels().get(i).getCommValue();
			}
		}
	}

	return mail;
}
 
Example 32
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private CommChannelVo getCommChannel(ChannelType channelType, Object channelValue, CommChannelVoCollection commChannelVoCollection) 
{
	if(commChannelVoCollection == null)
		return null;
	
	if(channelType == null || channelValue == null)
		return null;
	
	for(CommChannelVo channel : commChannelVoCollection)
	{
		if(channel == null)
			continue;
		
		if(channel.getChannelType().equals(channelType) && channel.getCommValue().equals(channelValue))
			return channel;
	}
	
	return null;
}
 
Example 33
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnUpdateClick() throws PresentationLogicException
{
	// AppUserVo user = domain.getAppUser(form.grdAppUsers().getValue());
	// form.getLocalContext().setAppUserVo(user);
	form.setMode(FormMode.EDIT);
	form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
	form.btnUpdate().setEnabled(false);
	if (form.getLocalContext().getAppUserVoIsNotNull())
		if (form.getLocalContext().getAppUserVo().getMosIsNotNull())
			if (form.getLocalContext().getAppUserVo().getMos().getCommChannelsIsNotNull())
				for (int i=0;i<form.getLocalContext().getAppUserVo().getMos().getCommChannels().size();i++)
				{
					if (form.getLocalContext().getAppUserVo().getMos().getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL))
					{
						
						form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo()));
					}
				}
	
}
 
Example 34
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbMosValueChanged() throws PresentationLogicException 
{
	if (form.qmbMos().getValue()!=null)
	{
		MemberOfStaffShortVo mos = form.qmbMos().getValue();
		if (mos.getCommChannelsIsNotNull())
			for (int i=0;i<mos.getCommChannels().size();i++)
			{
				if (mos.getCommChannels().get(i).getChannelType().equals(ChannelType.EMAIL))
				{
					form.getGlobalContext().Admin.setuserEmailAccount(domain.getEmailData(form.getLocalContext().getAppUserVo().toAppUserRefVo()));
				}
			}
		form.lnkEmailAccountInfo().setEnabled(true);
	}
	
}
 
Example 35
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void checkIfCheckBoxShouldBeDisplayedAnyway(DischargeReadyToLeaveVo voReady) 
{
	GP voGP = domain.getPatientsGP(form.getGlobalContext().Core.getPatientShort());
	boolean hasEmail = false;
	if (voGP != null && voGP.getCommChannel(ChannelType.EMAIL) != null)
		hasEmail = true;
		
	DischargeDetailsVo volocalDD = domain.getDischargeDetails(form.getGlobalContext().Core.getCurrentCareContext());
	form.getLocalContext().setCurrentDischargeDetailsVo(volocalDD);

	if ( !hasEmail
		&& volocalDD != null
		&& volocalDD.getDischargeLetterStatusIsNotNull()
		&& volocalDD.getDischargeLetterStatus().equals(DischargeLetterStatus.GENERATED)
		&& (voReady.getHasPatientReceivedCopyOfDischarge() == null
				|| (voReady.getHasPatientReceivedCopyOfDischargeIsNotNull()	&&  ! voReady.getHasPatientReceivedCopyOfDischarge()) ) )
	{
		form.chkLetterGiven().setVisible(true);
		form.lblLetterGiven().setVisible(true);
		
		if (form.getMode().equals(FormMode.EDIT))
			form.chkLetterGiven().setEnabled(true);
	}
	
}
 
Example 36
Project: openMAXIMS   File: EDischargePatientReadyToLeaveSTHKComponentImpl.java   View source code 6 votes vote down vote up
public String getDisplayStringAfterSave(SummaryRefVo summaryId)
{
	//Get number of incomplete sections
	String hql = "select count (detail.id) from Summary as summa left join summa.summaryDetails as detail where " +
			"(summa.id = :summaryId and detail.progressStatus.id <> :progressId and summa.isRIE is null and detail.isRIE is null)";
	DomainFactory df = getDomainFactory();
	long noOfNotCompleted = df.countWithHQL(hql, new String[] {"summaryId","progressId"}, new Object[]{summaryId.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID()});
	if (noOfNotCompleted > 0)
		return null;
	
	//Get GP's email
	hql = "select comm.commValue from Summary as summary left join summary.careContext as cc left join cc.episodeOfCare as eoc " +
			"left join eoc.careSpell as cs left join cs.patient as pat left join pat.gp as gp " +
			"left join gp.commChannels as comm left join comm.channelType as chanType where (summary.id = :summId and chanType.id = :emailId)"; 
	List<?> find = df.find(hql,new String[]{"summId","emailId"},new Object[]{summaryId.getID_Summary(),ChannelType.EMAIL.getID()});
	if (find!=null && find.size() > 0)
	{
		if (find.get(0) instanceof String)
		{
			String email = (String) find.get(0);
			if (email.trim().length()>0)
				return "Discharge Summary Sent to GP";
		}
	}
	return "Discharge Summary Sent to Print";
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
public void populateScreenFromData(PersonAddress pa)
{
	if (pa != null)
	{
		pa.setPhone(pa.getPhone());

		if (form.getGlobalContext().Core.getPatientShortIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannelsIsNotNull()
			&& form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE) != null)
			pa.setPhone(form.getGlobalContext().Core.getPatientShort().getCommChannels().getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue());
		
		form.ccAddress().setValue(pa);
		form.txtOtherPhone().setValue(pa.getOtherphone());
		form.cmbAddressType().setValue(pa.getAddressTypeIsNotNull()?pa.getAddressType():null);
		form.getLocalContext().setpersonAddress(pa);
	}
	form.getLocalContext().setaddressIndex(form.recbrAddress().getSelectedIndex());
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void doCopy()
{
	clearAddressControls();
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
		
		//start WDEV-14370
		if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
		{
			personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
		}
		//end
		
		form.ccAddressSearch().setComponentEnabled(false);//WDEV-17432
		
		populateScreenFromData(personAddress);
		displayPhoneNumbers();
		
		form.ccAddressSearch().setComponentEnabled(true);//WDEV-17432
	}
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private String getTelephone(GpLiteVo gp)
{
	if (gp == null)
		return null;
	if (!gp.getCommChannelsIsNotNull())
		return null;
	for (int i = 0 ; i < gp.getCommChannels().size() ; i++)
	{
		CommChannelVo commChannelVo = gp.getCommChannels().get(i);
		if (ChannelType.GEN_PHONE.equals(commChannelVo.getChannelType()) || 
				ChannelType.HOME_PHONE.equals(commChannelVo.getChannelType()) ||
				ChannelType.WORK_PHONE.equals(commChannelVo.getChannelType()) ||
				ChannelType.MOBILE.equals(commChannelVo.getChannelType()))
				return commChannelVo.getCommValue();
	}	
	return null;
}
 
Example 40
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private String getGpMailAddress(GpLiteVo patientGp)
{
	if (patientGp == null)
		return null;

	String mail = null;

	if (patientGp.getCommChannelsIsNotNull())
	{
		for (int i = 0; i < patientGp.getCommChannels().size(); i++)
		{
			if (patientGp.getCommChannels().get(i) == null)
				continue;

			if (ChannelType.EMAIL.equals(patientGp.getCommChannels().get(i).getChannelType()) && patientGp.getCommChannels().get(i).getCommValue() != null)
			{
				mail = patientGp.getCommChannels().get(i).getCommValue();
			}
		}
	}

	return mail;
}