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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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 41
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 42
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 43
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 44
Project: openmaxims-linux   File: EDischargePatientReadyToLeaveSTHKComponentImpl.java   Source Code and License 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 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getPracticePhoneNumber(CommChannelVoCollection commChannels)
{
	String value = "";
	
	if (commChannels == null)
		return "";
	
	if (commChannels != null)
	{
		for (int i = 0; i < commChannels.size(); i++)
		{
			CommChannelVo row = commChannels.get(i);
			
			if (row != null)
			{
				if (row.getChannelTypeIsNotNull())
					if (row.getChannelType().equals(ChannelType.GEN_PHONE))
					{
						value = row.getCommValue();
						break;
					}
			}
		}
	}
	
	return value;
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setPracticePhoneAndFax(OrganisationWithSitesVo practice)
{
	if (practice.getCommChannelsIsNotNull()) //WDEV-16051
	{
		GpShortVo gp = form.getGlobalContext().Core.getGPDetails();
		// WORK PHONE
		CommChannelVo gpWorkPhone = gp.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE);
		CommChannelVo practiceWorkPhone = practice.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE);

		if (gpWorkPhone != null && gpWorkPhone.getCommValueIsNotNull())
		{
			form.txtPhone().setValue(gpWorkPhone.toString());
			form.lblPhone().setValue("GP Phone:");
		}
		else if (practiceWorkPhone != null && practiceWorkPhone.getCommValueIsNotNull())
		{
			form.txtPhone().setValue(practiceWorkPhone.toString());
			form.lblPhone().setValue("Practice Phone:");
		}
		else
			form.lblPhone().setValue("Practice Phone:");

		// FAX NUMBER
		CommChannelVo gpFax = gp.getCommChannels().getCommunicationChannel(ChannelType.FAX);
		CommChannelVo practiceFax = practice.getCommChannels().getCommunicationChannel(ChannelType.FAX);

		if (gpFax != null && gpFax.getCommValueIsNotNull())
		{
			form.txtFax().setValue(gpFax.toString());
			form.lblFax().setValue("GP Fax:");
		}
		else if (practiceFax != null && practiceFax.getCommValueIsNotNull())
		{
			form.txtFax().setValue(practiceFax.toString());
			form.lblFax().setValue("Practice Fax:");
		}
		else
			form.lblFax().setValue("Practice Fax:");
	}
}
 
Example 47
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderNextOfKinVoToNK1(NextOfKin nok, NK1 nk1,ProviderSystemVo providerSystem) throws Exception
{
	LOG.debug("VoMapper renderNextOfKinVoToNK1: entry");
	if (nok == null)
		return;

	renderNameVoToXPN(nok.getName(), nk1.getNKName(0),providerSystem);
	renderAddressVoToXAD(nok.getAddress(), nk1.getAddress(0),providerSystem);

	CommChannelVo voWork = nok.getCommunicationChannel(ChannelType.WORK_PHONE);
	if (voWork != null)
		nk1.getBusinessPhoneNumber(0).getAnyText().setValue(voWork.getCommValue());
	CommChannelVo vo = nok.getCommunicationChannel(ChannelType.HOME_PHONE);
	if (vo != null)
	{
		nk1.getPhoneNumber(0).getAnyText().setValue(vo.getCommValue());
	}
	else
	{
		// wdev-3087 Check if home phone is set at address level
		if (nok.getAddressIsNotNull() && nok.getAddress().getPhoneIsNotNull())
			nk1.getPhoneNumber(0).getAnyText().setValue(nok.getAddress().getPhone());
	}

	if (nok.getRelationshipIsNotNull())
		nk1.getRelationship().getIdentifier().setValue(svc.getRemoteLookup(nok.getRelationship().getID(), providerSystem.getCodeSystem().getText()));

	LOG.debug("VoMapper renderNextOfKinVoToNK1: exit (" + nk1.toString() + ")");
}
 
Example 48
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderCommChannelVoToXTN(CommChannelVo vo, XTN xtn) throws DataTypeException
{
	if (vo == null)
		return;
		
	LOG.debug("VoMapper renderCommChannelVoToXTN: entry");
	
	xtn.getAnyText().setValue(vo.getCommValue());
	if (vo.getChannelType().equals(ChannelType.BLEEP))
	{
		xtn.getTelecommunicationEquipmentType().setValue("BP"); 
	}
	else if (vo.getChannelType().equals(ChannelType.EMAIL))
	{
		xtn.getEmailAddress().setValue(vo.getCommValue());
		xtn.getTelecommunicationEquipmentType().setValue("Internet");
		xtn.getTelecommunicationUseCode().setValue("NET");
	}
	else if (vo.getChannelType().equals(ChannelType.FAX))
	{
		xtn.getTelecommunicationEquipmentType().setValue("FX");
	}
	else if (vo.getChannelType().equals(ChannelType.MOBILE) || vo.getChannelType().equals(ChannelType.HOME_PHONE) ||
			vo.getChannelType().equals(ChannelType.WORK_PHONE))
	{
		//xtn.getPhoneNumber().setValue(vo.getCommValue()); 
		xtn.getTelecommunicationEquipmentType().setValue("PH");
	}
			
	LOG.debug("VoMapper renderCommChannelVoToXTN: exit");
}
 
Example 49
Project: AvoinApotti   File: M02VoMapper.java   Source Code and License 5 votes vote down vote up
private int findWorkPhone(CommChannelVoCollection commChannels)
{
	int ix = -1;
	for (int i = 0; i < commChannels.size(); i++)
	{
		if (commChannels.get(i).getChannelTypeIsNotNull() && commChannels.get(i).getChannelType().equals(ChannelType.WORK_PHONE))
		{								
			ix = i;
			break;
		}
	}
	return ix;		
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getCommChannel(ims.core.vo.CommChannelVoCollection voCollCommChannel, ims.core.vo.lookups.ChannelType lkChannelType)
{
	if (voCollCommChannel != null && voCollCommChannel.size() > 0)
	{
		for (int i = 0; i < voCollCommChannel.size(); i++)
			if (voCollCommChannel.get(i).getChannelType().equals(lkChannelType))
				return voCollCommChannel.get(i).getCommValue();
	}
	return null;
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addGpToGrid(GPLiteWithCommChannelsVo voGp)
{
	if (voGp == null ) return;
	//check if this GP already exists
	if (isGpAlreadyAdded(voGp)){
		engine.showErrors(new String[]{"The GP is already in the list"});
		return;
	}
	
	grdReciepientRow row = form.grdReciepient().getRows().newRow();
	String gpName = voGp.getNameIsNotNull() ?  voGp.getName().toString() : "";
	
	row.setValue(voGp);
	String emails = "";
	if (voGp != null)
	{
		for (int j = 0; j < voGp.getCommChannels().size(); j++) 
		{
			if (voGp.getCommChannels().get(j).getChannelType().equals(ChannelType.EMAIL))
			{
				emails += "Email : " +  voGp.getCommChannels().get(j).getCommValue() + "<br>";
			}
		}
		if (emails == "")
			emails = "No email";
	}
	row.setColRecipient(gpName+", "+emails);
	row.setTooltip(emails);
}
 
Example 52
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getPracticePhoneNumber(CommChannelVoCollection commChannels)
{
	String value = "";
	
	if (commChannels == null)
		return "";
	
	if (commChannels != null)
	{
		for (int i = 0; i < commChannels.size(); i++)
		{
			CommChannelVo row = commChannels.get(i);
			
			if (row != null)
			{
				if (row.getChannelTypeIsNotNull())
					if (row.getChannelType().equals(ChannelType.GEN_PHONE))
					{
						value = row.getCommValue();
						break;
					}
			}
		}
	}
	
	return value;
}
 
Example 53
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setPracticePhoneAndFax(OrganisationWithSitesVo practice)
{
	if (practice.getCommChannelsIsNotNull()) //WDEV-16051
	{
		GpShortVo gp = form.getGlobalContext().Core.getGPDetails();
		// WORK PHONE
		CommChannelVo gpWorkPhone = gp.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE);
		CommChannelVo practiceWorkPhone = practice.getCommChannels().getCommunicationChannel(ChannelType.WORK_PHONE);

		if (gpWorkPhone != null && gpWorkPhone.getCommValueIsNotNull())
		{
			form.txtPhone().setValue(gpWorkPhone.toString());
			form.lblPhone().setValue("GP Phone:");
		}
		else if (practiceWorkPhone != null && practiceWorkPhone.getCommValueIsNotNull())
		{
			form.txtPhone().setValue(practiceWorkPhone.toString());
			form.lblPhone().setValue("Practice Phone:");
		}
		else
			form.lblPhone().setValue("Practice Phone:");

		// FAX NUMBER
		CommChannelVo gpFax = gp.getCommChannels().getCommunicationChannel(ChannelType.FAX);
		CommChannelVo practiceFax = practice.getCommChannels().getCommunicationChannel(ChannelType.FAX);

		if (gpFax != null && gpFax.getCommValueIsNotNull())
		{
			form.txtFax().setValue(gpFax.toString());
			form.lblFax().setValue("GP Fax:");
		}
		else if (practiceFax != null && practiceFax.getCommValueIsNotNull())
		{
			form.txtFax().setValue(practiceFax.toString());
			form.lblFax().setValue("Practice Fax:");
		}
		else
			form.lblFax().setValue("Practice Fax:");
	}
}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void doCopy()
{
	if (form.getGlobalContext().Core.getNOKPersonAddressIsNotNull())
	{
		PersonAddress personAddress = (PersonAddress) form.getGlobalContext().Core.getNOKPersonAddress().clone();
	
   		personAddress.setPhone(form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE) !=null ? form.getGlobalContext().Core.getCommChannels().getCommunicationChannel(ChannelType.HOME_PHONE).getCommValue() : null);
   		form.ccAddress().setComponentEnabled(false);
   		form.ccAddress().setValue(personAddress);
   		form.ccAddress().setComponentEnabled(true);
	}
}
 
Example 55
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateCommChanels(CommChannelVoCollection commChannels)
{
	form.lyrContact().tabPageContact().grdCommChannels().getRows().clear();
	
	if(form.lyrContact().tabPageContact().grdCommChannels().colTypeComboBox().size() == 0)
	{
		ChannelType[] instances = ChannelType.getNegativeInstances();
		
		for(ChannelType inst : instances)
		{
			form.lyrContact().tabPageContact().grdCommChannels().colTypeComboBox().newRow(inst, inst.getText());
		}
	}
	
	grdCommChannelsRow rowCommChannel;

	if (commChannels != null)
	{
		for (int i = 0; i < commChannels.size(); i++)
		{
			CommChannelVo voCommChannel = commChannels.get(i);

			if (voCommChannel.getChannelTypeIsNotNull())
			{
				rowCommChannel = form.lyrContact().tabPageContact().grdCommChannels().getRows().newRow();
				rowCommChannel.setcolType(voCommChannel.getChannelType());
				rowCommChannel.setcolContactValue(voCommChannel.getCommValue());
				rowCommChannel.setcolUsage(voCommChannel.getChannelUsage());
				rowCommChannel.setValue(voCommChannel);
				
				//WDEV-21540 - if comm channel has an object identifier then the channeltype cannot be changed
				if(voCommChannel.getObjectidentifierIsNotNull() && voCommChannel.getObjectidentifier().length() > 0)
				{
					rowCommChannel.setcolTypeReadOnly(true);
				}
			}
		}

	}
}
 
Example 56
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private CommChannelVoCollection getCommChannelsByType(ChannelType channelType, CommChannelVoCollection commChannels)
{
	CommChannelVoCollection coll = new CommChannelVoCollection();
	
	if(commChannels == null)
		return coll;
	
	for(int i = 0; i < commChannels.size(); i++)
	{
		if(channelType.equals(commChannels.get(i).getChannelType()))
			coll.add(commChannels.get(i));
	}
	
	return coll;
}
 
Example 57
Project: openMAXIMS   File: PdsQuery.java   Source Code and License 5 votes vote down vote up
public String getPersonContactNumber(CommChannelVoCollection coll)
{
	if(coll == null || coll.size() == 0)
		return "";

	//this is the order in which the person contact number is build
	//if the first type in the list is not null within the collection "coll" then that value is returned 
	//else if the second value is not null within the collection "coll" then that value is returned
	//...
	//feel free to change the order within "ct" or add more types
	
	ChannelType[] ct = new ChannelType[] {
	ChannelType.EMERGENCY, //WDEV-22220
	ChannelType.GEN_PHONE,
	ChannelType.HOME_PHONE,
	ChannelType.MOBILE,
	ChannelType.WORK_PHONE
	};
	
	for(ChannelType t : ct)
	{
		for(CommChannelVo cc : coll)
		{
			if(t.equals(cc.getChannelType()))
				return cc.getCommValue();
		}
	}
	
	return "";
}
 
Example 58
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populatePatientDetails()
{
	PatientShort patient = form.getGlobalContext().Core.getPatientShort();
	if (patient != null)
	{
		form.PatientName().setValue(patient.getNameIsNotNull() ? patient.getName().getForename() + " " + patient.getName().getSurname() : "");
		form.PatientDOB().setValue(patient.getDobIsNotNull() ? patient.getDob().toString() : "");
		form.PatientHospitalNumber().setValue(patient.getHospnum() != null ? patient.getHospnum().getValue() : "");
		//ICCO688
		form.PatientTelephone().setValue(patient.getCommunicationChannel(ChannelType.GEN_PHONE) !=null ? patient.getCommunicationChannel(ChannelType.GEN_PHONE).getCommValue() : "");
		
		//WDEV-14336 start here
		if (patient.getAddressIsNotNull())
		{
			StringBuffer address = new StringBuffer(200);
			if(patient.getAddress().getLine1()!=null){
				address.append(patient.getAddress().getLine1());
				address.append(newLine);
			}
			if(patient.getAddress().getLine2()!=null){
				address.append(patient.getAddress().getLine2());
				address.append(newLine);
			}
			if(patient.getAddress().getLine3()!=null){
				address.append(patient.getAddress().getLine3());
				address.append(newLine);
			}
			if(patient.getAddress().getLine4()!=null){
				address.append(patient.getAddress().getLine4());
				address.append(newLine);
			}
			if(patient.getAddress().getLine5()!=null){
				address.append(patient.getAddress().getLine5());
				address.append(newLine);
			}
			form.PatientAddress().setValue(address.toString());
		}
		//WDEV-14336 end here
	}
}
 
Example 59
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final void renderCommChannelVoToXTN(CommChannelVo vo, XTN xtn) throws DataTypeException
{
	if (vo == null)
		return;
		
	LOG.debug("VoMapper renderCommChannelVoToXTN: entry");
	
	xtn.getAnyText().setValue(vo.getCommValue());
	
	if (vo.getChannelType().equals(ChannelType.BLEEP))
	{
		xtn.getTelecommunicationEquipmentType().setValue("BP"); 
	}
	else if (vo.getChannelType().equals(ChannelType.EMAIL))
	{
		xtn.getEmailAddress().setValue(vo.getCommValue());
		xtn.getTelecommunicationEquipmentType().setValue("Internet");
		xtn.getTelecommunicationUseCode().setValue("NET");
	}
	else if (vo.getChannelType().equals(ChannelType.FAX))
	{
		xtn.getTelecommunicationEquipmentType().setValue("FX");
	}
	else if (vo.getChannelType().equals(ChannelType.MOBILE) || vo.getChannelType().equals(ChannelType.HOME_PHONE) ||
			vo.getChannelType().equals(ChannelType.WORK_PHONE))
	{
		xtn.getTelecommunicationEquipmentType().setValue("PH");
	}
			
	LOG.debug("VoMapper renderCommChannelVoToXTN: exit");
}
 
Example 60
Project: openMAXIMS   File: M02VoMapper.java   Source Code and License 5 votes vote down vote up
private int findWorkPhone(CommChannelVoCollection commChannels)
{
	int ix = -1;
	for (int i = 0; i < commChannels.size(); i++)
	{
		if (commChannels.get(i).getChannelTypeIsNotNull() && commChannels.get(i).getChannelType().equals(ChannelType.WORK_PHONE))
		{								
			ix = i;
			break;
		}
	}
	return ix;		
}